You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
461 B
461 B
id | title | layout | permalink | prev | next |
---|---|---|---|---|---|
self-closing-tag | Self-Closing Tag | tips | self-closing-tag.html | if-else-in-JSX.html | maximum-number-of-jsx-root-nodes.html |
In JSX, <MyComponent />
alone is valid while <MyComponent>
isn't. All tags must be closed, either with the self-closing format or with a corresponding closing tag (</MyComponent>
).
Note:
Every React component can be self-closing:
<div />
.<div></div>
is also an equivalent.