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.
Please login to continue.