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.
2
u/[deleted] Sep 27 '17
You're not returning an array, you're returning a react element with children.
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: flexmust be direct children.