Render Multiple Elements using React.Fragment and the JSX Fragment Syntax <> in React 16.2

Nik Graf
InstructorNik Graf

Share this video with your friends

Send Tweet

With React 16 it is possible now to return an Array of elements.

In React 16.2 support for fragments was added. It's a convenient way to return multiple children from a component’s render method.

spencer
spencer
~ 3 years ago

Because they don't require a "key", does that mean react does not track them the same as an list item with a key?

Nik Graf
Nik Grafinstructor
~ 3 years ago

@spencer From what I understood components inherently get tracked correct and that's why keys are not needed.