Error AtlasError Documentation and Resolution

React.Children.only expected a single child

React.Children.only expected to receive a single React element child.

React received multiple children or a non-element value where an API explicitly expects exactly one React element child.

React error #143runtime
React.Children.only expected to receive a single React element child.
  • A component passed multiple children to an API expecting exactly one element.
  • A fragment, string, or null was supplied where a single React element is required.
  • A wrapper component forwards children to React.Children.only without validating the shape.
  1. Pass a single React element child instead of multiple siblings.
  2. Wrap multiple children in a single container element if appropriate.
  3. Review components using React.Children.only and ensure the caller matches the contract.
React Docs: Minified React error #143
React error #143 expected a single child: causes and fixes | Error Atlas