diff --git a/packages/core/src/jsx-runtime.ts b/packages/core/src/jsx-runtime.ts index 111a018b0..31a5638c2 100644 --- a/packages/core/src/jsx-runtime.ts +++ b/packages/core/src/jsx-runtime.ts @@ -23,7 +23,7 @@ export function Fragment(props: { children: JSXRenderer[] }) { return props.children } -export const h: JSXRenderer = (tag, attributes, ...children) => { +export const h: JSXRenderer = (tag, attributes) => { // Treat the slot tag as the Prosemirror hole to render content into if (tag === 'slot') { return 0 @@ -34,8 +34,10 @@ export const h: JSXRenderer = (tag, attributes, ...children) => { return tag(attributes) } + const { children, ...rest } = attributes ?? {} + // Otherwise, return the tag, attributes, and children - return [tag, attributes ?? {}, ...children] + return [tag, rest, children] } // See