ReactNode typedef

ReactNode = Object?

A value that can be returned from a component's render, or used as children.

Possible values include:

  • A ReactElement such as a DOM element created using react.div({}), or a user-defined component.
  • A ReactPortal created by createPortal.
  • A String or num (Rendered as text nodes in the DOM).
  • Booleans or null (Render nothing).
  • A list of, or a ReactFragment containing, any/all of the above.

See also: https://github.com/facebook/react/blob/b3003047101b4c7a643788a8faf576f7e370fb45/packages/shared/ReactTypes.js#L10

Implementation

typedef ReactNode = Object?;