Represents all of the things React can render.
Where ReactElement only represents JSX, ReactNode represents everything that can be rendered.
ReactNode
React TypeScript Cheatsheet
// Typing childrentype Props = { children: ReactNode }const Component = ({ children }: Props) => <div>{children}</div><Component>hello</Component>
// Typing a custom elementtype Props = { customElement: ReactNode }const Component = ({ customElement }: Props) => <div>{customElement}</div><Component customElement={<div>hello</div>} />
Generated using TypeDoc
Represents all of the things React can render.
Where ReactElement only represents JSX,
ReactNode
represents everything that can be rendered.See
React TypeScript Cheatsheet
Example
Example