Update "Adjacent JSX elements must be wrapped in an enclosing tag" for React 16
React 16 does not require container elements. Is this going to be updated?
Airbnb still uses React 15; however I'm not sure you're correct.
React 16 allows you to return an array of elements, but jsx syntax itself requires the enclosing tag.
Can you provide an example?
@ljharb From the React 16 Docs:
render() {
// No need to wrap list items in an extra element!
return [
// Don't forget the keys :)
<li key="A">First item</li>,
<li key="B">Second item</li>,
<li key="C">Third item</li>,
];
}
@monsonjeremy that's an array of elements; note the brackets.
If you removed those, you'd get a syntax error, since they'd need to be wrapped in an enclosing tag.
I'm agreeing with @ljharb here and thinking there's nothing that's actually amiss with the current implementation. Feel free to close.
I forgot a comma and also get this error.