You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I see there is Fragment support added in #16 but it does not yet conform to the Typescript jsxFragmentFactory implementation in microsoft/TypeScript#35392 at all.
Adding const Fragment = ({ children }: { children: string[] }) => h(null as any, null, ...children); to the source file seems sufficient, but, it should be added into vhtml itself for jsxFragmentFactory to work more seamlessly.
allows me to use fragments with vhtml even though #33 is not merged. I don't know why this is.
I suppose it might depend on the bundler. I'm currently using esbuild, but maybe it's worth a shot for others to try instead of waiting for support to be merged here?
Activity
mappu commentedon Jun 3, 2021
I see there is Fragment support added in #16 but it does not yet conform to the Typescript jsxFragmentFactory implementation in microsoft/TypeScript#35392 at all.
Adding
const Fragment = ({ children }: { children: string[] }) => h(null as any, null, ...children);to the source file seems sufficient, but, it should be added into vhtml itself for jsxFragmentFactory to work more seamlessly.feat: support typescript jsxFragmentFactory
odinhb commentedon Oct 20, 2022
I wanted to mention that configuring tsconfig as
allows me to use fragments with vhtml even though #33 is not merged. I don't know why this is.
I suppose it might depend on the bundler. I'm currently using esbuild, but maybe it's worth a shot for others to try instead of waiting for support to be merged here?
r-thomson commentedon Mar 4, 2023
The solution is to set up your config like this:
See these test cases:
vhtml/test/vhtml.js
Lines 177 to 191 in 96fe21e
jcubic commentedon Dec 30, 2023
vhtml.Fragmentworks.I have a working demo on CodePen