Skip to content

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 for children and "slot" props.
  • ReactElement<P>: a single element object (<X />), with its props type. Use when you must cloneElement or read props.
  • 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.