diff --git a/src/renderers/__snapshots__/react.test.ts.snap b/src/renderers/__snapshots__/react.test.ts.snap index d9cdebe..2e6abf2 100644 --- a/src/renderers/__snapshots__/react.test.ts.snap +++ b/src/renderers/__snapshots__/react.test.ts.snap @@ -9,7 +9,7 @@ import type { PropsWithChildren } from 'hono/jsx' type Props = { attr?: 'a' | 'b', attrFooBar?: 'foo-bar', isFoo?: boolean, propFoo?: string, propBar?: string } & JSX.IntrinsicElements['div'] export function Foo({ children, attr, attrFooBar, isFoo, propFoo, propBar, ...props }: PropsWithChildren) { - return (
\${children}
) + return (
{children}
) } " `; @@ -23,7 +23,7 @@ import type { JSX, PropsWithChildren } from 'react' type Props = { attr?: 'a' | 'b', attrFooBar?: 'foo-bar', isFoo?: boolean, propFoo?: string, propBar?: string } & JSX.IntrinsicElements['div'] export function Foo({ children, attr, attrFooBar, isFoo, propFoo, propBar, ...props }: PropsWithChildren) { - return (
\${children}
) + return (
{children}
) } " `; @@ -37,7 +37,7 @@ import type { JSX, PropsWithChildren } from 'react' type Props = { } & JSX.IntrinsicElements['div'] export function Foo({ children, ...props }: PropsWithChildren) { - return (
\${children}
) + return (
{children}
) } " `; diff --git a/src/renderers/react.ts b/src/renderers/react.ts index d4aa28f..ad6f9ad 100644 --- a/src/renderers/react.ts +++ b/src/renderers/react.ts @@ -32,11 +32,10 @@ function renderFunction(data: Data, isClass: boolean): string { ].join(', ') return `export function ${pascalCase(data.className)}({ ${args} }: ${hasChildren(data.tag) ? `PropsWithChildren` : `Props`}) { - return (${renderTag(data, '${children}', isClass ? 'class' : 'className')}) + return (${renderTag(data, '{children}', isClass ? 'class' : 'className')}) }` } - export function render(name: string, data: Data, isHono = false): string { return `// Generated by MistCSS, do not modify import './${name}.mist.css'