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

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
~ 6 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 Grafinstructor
~ 6 years ago

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