FlashcardNot attempted
ReactNode vs ReactElement vs JSX.Element
Recall it before you reveal
When do you use ReactNode, ReactElement and JSX.Element?
Space to reveal
Show answer & explanation
- ReactNode: anything renderable (elements, strings, numbers,
null, booleans, arrays, React 19 promises). Use forchildrenand "slot" props. - ReactElement<P>: a single element object (
<X />), with its props type. Use when you mustcloneElementor readprops. - JSX.Element:
ReactElement<any, any>, the type a JSX expression produces. Rarely needed in annotations.
React 19 types removed the global JSX namespace: write React.JSX.Element. Components can return any ReactNode, so you rarely annotate return types at all.