paint-brush
I would recommend always closing tags.by@connordav.is

I would recommend always closing tags.

by Connor DavisJanuary 20th, 2018
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

I would recommend always closing tags. It’s an easy thing to remember. When you delve into Javascript and JSX you realize that void tags MUST be closed to be valid. This makes sense because developer defined components can be void elements as well. For example a header component:

Company Mentioned

Mention Thumbnail
featured image - I would recommend always closing tags.
Connor Davis HackerNoon profile picture

I would recommend always closing tags. It’s an easy thing to remember. When you delve into Javascript and JSX you realize that void tags MUST be closed to be valid. This makes sense because developer defined components can be void elements as well. For example a header component:

<div id=”app”>

<Header />

<h1>Hello World!<h1>

</div>

It’s also a pain if you copy someone’s html into a JSX component and there’s a bunch of unclosed elements that cause errors.

L O A D I N G
. . . comments & more!

About Author

Connor Davis HackerNoon profile picture
Connor Davis@connordav.is

TOPICS

THIS ARTICLE WAS FEATURED IN...