-
Notifications
You must be signed in to change notification settings - Fork 12.3k
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
JSX Fragments are in-properly typed when not using React.Fragment
#50429
Comments
@RyanCavanaugh Should TypeScript/src/compiler/types.ts Lines 2802 to 2808 in ed6889c
It does not have Or do we need to make a special kind of fragment factory (with a synthetic name) call resolving? |
It sounds like the answer is "yes it should be a call-like expression", but also you will need to virtualize a target. I don't know if we still do that, but we have helpers like |
**Description:** TypeScript does not validate JSX Fragments properly. **Related issue:** - microsoft/TypeScript#50429
Could this be solved in a similar manner to #51328? Libraries/types could define something like |
Bug Report
π Search Terms
React Fragment
π Version & Regression Information
I believe this is a new inconsistency due to changes in React.
β― Playground Link
https://github.com/gkemp94/test-typescript-fragment
Code
π Actual behavior
When using
<>
vs<React.Fragment>
the children are not properly type checkedπ Expected behavior
When jsx: react is specified, to type check
<>
the same asReact.Fragment
The text was updated successfully, but these errors were encountered: