Re:Things every React.js beginner should know
by EvanPlaice on Monday January 25, 2016 @09:10AM
(#10967227)
JSX is a HTML-like template language that gets preprocessed to actual HTML.
[ Parent
| on HN ]
Re:Things every React.js beginner should know
by Guillaume86 on Monday January 25, 2016 @10:09AM
(#10967540)
No it's not getting preprocessed to actual HTML in React. Depending on the transform function, it can be turned to an object tree or a function calls tree (like in React) or actually HTML like you said but it's not a common use case AFAIK.
It's not a text templating language like classic PHP, it's an object/function calls hierarchy DSL (more like vb.net XML literals). I think most people critisizing react for putting html in JS havn't tried it or don't remember why "html" in code was considered bad in the first place.
Re:Things every React.js beginner should know
by EvanPlaice on Tuesday January 26, 2016 @02:47PM
(#10975476)
Right. I was aiming for the 'simple' answer but should have said DOM instead of HTML.
I'm also thinking in more of an Angular2 context as that's what I'm most familiar with.