DEV Community

Discussion on: Anyone else intolerant of html inside javascript? yes i mean React

Collapse
 
seanmclem profile image
Seanmclem • Edited

I'm intolerant of html outside of JS 😉

Jokes aside this is the way I like to write html. If you look into new native web components - usually the html is inside the js as a string or through jsx. So this style isn't going anywhere.

When you write js you'll often end up interacting with the Dom often enough to have it make sense to so tightly couple them.

Realistically, I'm not sure why we even have html files anymore. Or an html based Dom for that matter. When your js can hold an entire Dom tree - why not just have a browser render that directly?

Collapse
 
ceyhunkerti profile image
Ceyhun Kerti • Edited

why we even have html files anymore
I was thinking that a couple of years ago and mithril was the closest thing to that, i had found. Never used it though.