import React from "react";
const test = () => "asd";
// No Errors
const jsxWithJsxFragment = <>{test}</>;
// Type '() => string' is not assignable to type 'ReactNode'.
const jsxWithReactFragment = <React.Fragment>{test}</React.Fragment>;
π 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 as React.Fragment
The text was updated successfully, but these errors were encountered:
It does not have tagName(which we use in JsxOpeningLikeElement to resolve call) and other common CallLikeExpression properties - attributes, typeArguments, etc.
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 getEffective____ for getting the arguments we should check against.
Bug Report
React Fragment
I believe this is a new inconsistency due to changes in React.
https://github.com/gkemp94/test-typescript-fragment
Code
When using
<>vs<React.Fragment>the children are not properly type checkedWhen jsx: react is specified, to type check
<>the same asReact.FragmentThe text was updated successfully, but these errors were encountered: