Changed tag to element as its easy to understand (#27543)

* Changed tag to element as its easy to understand

* Minor grammar fixes
This commit is contained in:
Kyle Polson
2019-03-09 01:31:24 -08:00
committed by The Coding Aviator
parent 2ea2f9b752
commit de7312cf83

View File

@ -49,15 +49,19 @@ function who() {
const greet = <h1>Hello {who()}!</h1>; const greet = <h1>Hello {who()}!</h1>;
``` ```
### Only a single parent tag is allowed ### Only a single parent tag is allowed
A JSX expression must have only one parent tag. We can add multiple tags nested within the parent element only. A JSX expression must have only one parent element. We can have multiple elements nested within the parent element.
```jsx ```jsx
// This is valid. // This is valid.
const tags = ( const tags = (
<ul> <div>
<li>Once</li> <h1>Hello World!</h1>
<li>Twice</li> <h3>This is my special list:</h3>
</ul> <ul>
<li>Once</li>
<li>Twice</li>
</ul>
</div>
); );
// This is not valid. // This is not valid.