-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fragment / jsxFragment support #31
Comments
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 |
developit#31 ```json "jsxFragmentFactory": "Fragment", ``` or ```json "jsxFactory": "vhtml", "jsxFragmentFactory": "vhtml.Fragment", ``` --- ```ts import h, { Fragment } from 'vhtml'; ```
I wanted to mention that configuring tsconfig as "jsx": "react",
"jsxFactory": "h",
"jsxFragmentFactory": "h.Fragment", allows me to use fragments with vhtml even though #33 is not merged. I don't know why this is. |
The solution is to set up your config like this: {
jsxFactory: 'h',
jsxFragment: 'null',
} See these test cases: Lines 177 to 191 in 96fe21e
|
I have a working demo on CodePen |
Hi, this is a cool project, thanks so much.
I am using Typescript to compile the JSX, with this tsconfig.json:
Most code is converted properly, except when using a fragment:
this warning from Typescript is given:
I tried
"jsxFragmentFactory": "Fragment",
in tsconfig.json but of course no such Fragment is known nor exported from thevhtml
import.<tr>
siblings as per the above example?The text was updated successfully, but these errors were encountered: