Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
  • Loading branch information
remcohaszing committed Feb 13, 2024
commit 8c62e7f59aa80080da518e33abfbf005a31cc30d
4 changes: 2 additions & 2 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
Expand All @@ -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`.
Expand Down
3 changes: 3 additions & 0 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,7 @@ test('properties', async function (t) {
}),
{
...production,
/** @param {unknown} type */
jsx(type, props) {
foundProps = props
return production.jsx(type, {})
Expand Down Expand Up @@ -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, {})
Expand All @@ -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, {})
Expand Down