liveBook · Manning

React.Fragment

React.Fragment is a built-in React component that groups multiple children without adding a corresponding DOM element.

How 2 Manning books explain it

Build a Frontend Web Framework (From Scratch)

A virtual DOM node that groups multiple children without adding a parent element to the rendered document.

How it is used
Groups multiple component-generated children without adding a wrapper element to the DOM.
How deep it goes
Works through child mounting and reconciliation flattening rather than treating the fragment as a DOM element.
Examples
Uses a to-do application component that groups a heading, a form component, and a list component.
What you can do after
Build it from scratch with hFragment(), then mount its children directly under a shared DOM parent.

Read how Build a Frontend Web Framework (From Scratch) explains React.Fragment →

React Quickly, Second Edition

React.Fragment is a built-in React component that groups multiple children without producing a corresponding DOM element or HTML output.

How it is used
Groups sibling JSX elements when a root or component return requires one element without adding a DOM wrapper.
How deep it goes
Defines explicit and shorthand syntax, then applies keyed Fragments to mapped definition-list entries.
Examples
Demonstrates heading-and-link siblings and dog-breed definition lists rendered with keyed Fragments.
What you can do after
Apply it via React and JSX to group siblings without wrapper markup and render mapped pairs with stable keys.

Read how React Quickly, Second Edition explains React.Fragment →

Related concepts

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.