-
Notifications
You must be signed in to change notification settings - Fork 13k
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptFix AvailableA PR has been opened for this issueA PR has been opened for this issueRescheduledThis issue was previously scheduled to an earlier milestoneThis issue was previously scheduled to an earlier milestone
Milestone
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
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptFix AvailableA PR has been opened for this issueA PR has been opened for this issueRescheduledThis issue was previously scheduled to an earlier milestoneThis issue was previously scheduled to an earlier milestone