Skip to content

Commit

Permalink
feat: use the new JSX function syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
nperez0111 committed Oct 23, 2024
1 parent b4f7a2c commit d8ca76e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/core/src/jsx-runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit d8ca76e

Please sign in to comment.