Closed
Description
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
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