- 
                Notifications
    You must be signed in to change notification settings 
- Fork 4.3k
Closed
Labels
good first issueGood for newcomersGood for newcomers
Description
Hi. The Basic README claims that React.ReactNode is preferable to JSX.Element as a return value of a component because JSX.Element is a return type of React.createElement which is not, to put it simple, wide enough. Hovewer, when I attempt to use both to define the return type of a component, JSX.Element fits and React.ReactNode does not:
let C1 = (): JSX.Element => <div>test</div>
let c1 = <C1 />; // fine
let C2 = (): React.ReactNode => <div>test</div>
let c2 = <C2 />; // JSX Element type ReactNode is not a constructor function for JSX elements
// Type undefined is not assignable to type Element | nullWhat am I doing wrong?
Metadata
Metadata
Assignees
Labels
good first issueGood for newcomersGood for newcomers