From 8c62e7f59aa80080da518e33abfbf005a31cc30d Mon Sep 17 00:00:00 2001 From: Remco Haszing Date: Tue, 13 Feb 2024 14:16:29 +0100 Subject: [PATCH] Change the jsx callback type type to any This change makes the automatic runtime of some frameworks assignable to the runtime `hast-util-to-jsx-runtime` expects. --- lib/index.js | 4 ++-- test/index.js | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/index.js b/lib/index.js index 2a1b093..c40917d 100644 --- a/lib/index.js +++ b/lib/index.js @@ -90,7 +90,7 @@ * * @callback Jsx * Create a production element. - * @param {unknown} type + * @param {any} type * Element type: `Fragment` symbol, tag name (`string`), component. * @param {Props} props * Element props, `children`, and maybe `node`. @@ -101,7 +101,7 @@ * * @callback JsxDev * Create a development element. - * @param {unknown} type + * @param {any} type * Element type: `Fragment` symbol, tag name (`string`), component. * @param {Props} props * Element props, `children`, and maybe `node`. diff --git a/test/index.js b/test/index.js index 474a091..70cca2f 100644 --- a/test/index.js +++ b/test/index.js @@ -261,6 +261,7 @@ test('properties', async function (t) { }), { ...production, + /** @param {unknown} type */ jsx(type, props) { foundProps = props return production.jsx(type, {}) @@ -675,6 +676,7 @@ test('react specific: `align` to `style`', async function (t) { renderToStaticMarkup( toJsxRuntime(h('td', {align: 'center'}), { ...production, + /** @param {unknown} type */ jsx(type, props) { foundProps = props return production.jsx(type, {}) @@ -699,6 +701,7 @@ test('react specific: `align` to `style`', async function (t) { renderToStaticMarkup( toJsxRuntime(h('td', {align: 'center'}), { ...production, + /** @param {unknown} type */ jsx(type, props) { foundProps = props return production.jsx(type, {})