June 23, 2020

What are fragments?

It's common pattern in React which is used for a component to return multiple elements. Fragments let you group a list of children without adding extra nodes to the DOM.

There is also a shorter syntax, but it's not supported in many tools: