---
id: self-closing-tag
title: Self-Closing Tag
layout: tips
permalink: self-closing-tag.html
prev: if-else-in-JSX.html
next: 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.
