DEV Community

Discussion on: Is div still a div?

Collapse
 
proticm profile image
Milos Protic

Yes, we are talking about JSX :)

Do note that div is just an example element, the title is an abstract assumption that we no longer write normal good old HTML.

I mean, since React team introduced the JSX (as far as I know), our components do contain the word div but contextually it is not. It gets compiled to JavaScript that creates the div. So basically we have an extra step comparing to the old ways of doing things. I cannot decide whether this (everything is JavaScript) is good or bad, considering that it's really powerful and useful for templating.

Collapse
 
aziziyazit profile image
Azizi Yazit

We should use semantic HTML over div like Article, Nav, Header, Section and many more. Its super hard to debug JSX when everything is just a div.