Self-Closing Tag

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>).

Every React component can be self-closing: <div />. <div></div> is also an equivalent.

doc_React
2016-06-23 03:32:26
Comments
Leave a Comment

Please login to continue.