A JSX expression must have exactly how many outermost elements?

It must have exactly one outermost element.
var paragraphs = (
<div id="i-am-the-outermost-element">
<p>I am a paragraph.</p>
<p>I, too, am a paragraph.</p>
</div>
);

But this code will not work:
var paragraphs = (
<p>I am a paragraph.</p>
<p>I, too, am a paragraph.</p>
);
The first opening tag and the final closing tag of a JSX expression must belong to the same JSX element!

Comments

Archive

Contact Form

Send