# Type alias ReactNode

ReactNode: ReactElement | string | number | Iterable<ReactNode> | ReactPortal | boolean | null | undefined | DO_NOT_USE_OR_YOU_WILL_BE_FIRED_EXPERIMENTAL_REACT_NODES[keyof DO_NOT_USE_OR_YOU_WILL_BE_FIRED_EXPERIMENTAL_REACT_NODES]

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

    // Typing children
    type Props = { children: ReactNode }

    const Component = ({ children }: Props) => <div>{children}</div>

    <Component>hello</Component>

#### Example

    // Typing a custom element
    type Props = { customElement: ReactNode }

    const Component = ({ customElement }: Props) => <div>{customElement}</div>

    <Component customElement={<div>hello</div>} />

- Defined in common/temp/node_modules/.pnpm/@types+react@18.3.3/node_modules/@types/react/index.d.ts:478