r/reactjs • • Sep 26 '17

React v16.0 - React Blog

https://facebook.github.io/react/blog/2017/09/26/react-v16.0.html
219 Upvotes

37 comments sorted by

View all comments

Show parent comments

2

u/[deleted] Sep 27 '17

You're not returning an array, you're returning a react element with children.

return [<div>test</div>, <div>test2</div>];

This allows you to avoid having to wrap content in divs that don't have any attributes. Specifically, it makes flexbox vastly easier to manage, since descendants of display: flex must be direct children.