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 →

What to know first

Related concepts

Questions about React.Fragment

What is React.Fragment?

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

Which Manning books explain React.Fragment?

Build a Frontend Web Framework (From Scratch) and React Quickly, Second Edition.

What should I know before learning React.Fragment?

Manning books that teach React.Fragment usually introduce DOM element first.

What is the difference between React.Fragment and Document Object Model?

React.Fragment is a built-in React component that groups multiple children without adding a corresponding DOM element. The Document Object Model is a platform-independent programming interface that represents a document as a structured tree of nodes and provides ways to access and modify its content and structure.

What is React.Fragment a kind of?

React.Fragment is a kind of component. A software component is a modular part of a software system that provides or contributes functionality and interacts with other parts through defined boundaries.

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.