From 90e071f22cba3c9dac8f6aaa203d76a986fca49a Mon Sep 17 00:00:00 2001 From: Jovi De Croock Date: Fri, 12 Jan 2024 08:07:57 +0100 Subject: [PATCH] backport https://github.com/preactjs/preact/pull/3880 --- jsx-runtime/src/index.js | 7 ++++--- jsx-runtime/test/browser/jsx-runtime.test.js | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/jsx-runtime/src/index.js b/jsx-runtime/src/index.js index 85dd545379..c5b23efdc7 100644 --- a/jsx-runtime/src/index.js +++ b/jsx-runtime/src/index.js @@ -20,10 +20,11 @@ let vnodeId = 0; * @param {VNode['type']} type * @param {VNode['props']} props * @param {VNode['key']} [key] - * @param {string} [__source] - * @param {string} [__self] + * @param {unknown} [isStaticChildren] + * @param {unknown} [__source] + * @param {unknown} [__self] */ -function createVNode(type, props, key, __source, __self) { +function createVNode(type, props, key, isStaticChildren, __source, __self) { // We'll want to preserve `ref` in props to get rid of the need for // forwardRef components in the future, but that should happen via // a separate PR. diff --git a/jsx-runtime/test/browser/jsx-runtime.test.js b/jsx-runtime/test/browser/jsx-runtime.test.js index 2f66993e1c..acec971d29 100644 --- a/jsx-runtime/test/browser/jsx-runtime.test.js +++ b/jsx-runtime/test/browser/jsx-runtime.test.js @@ -1,4 +1,4 @@ -import { Component, createElement, createRef } from 'preact'; +import { createElement, createRef } from 'preact'; import { jsx, jsxs, jsxDEV, Fragment } from 'preact/jsx-runtime'; import { setupScratch, teardown } from '../../../test/_util/helpers'; @@ -32,7 +32,7 @@ describe('Babel jsx/jsxDEV', () => { }); it('should set __source and __self', () => { - const vnode = jsx('div', { class: 'foo' }, 'key', 'source', 'self'); + const vnode = jsx('div', { class: 'foo' }, 'key', false, 'source', 'self'); expect(vnode.__source).to.equal('source'); expect(vnode.__self).to.equal('self'); });