Hacker News new | past | comments | ask | show | jobs | submit login

The translation from JSX to JS is rather easy, though. It is just syntactic sugar.



You still need a full JS(x) parser (and lexer) though since / symbols are contextual (as are < in JSX).

/ and < in operator positions becomes operators, whilst / in plain JS in a value position becomes the start of an reg-exp and < becomes the start of an JSX tag, so to handle it there needs to be a full parser (with a pull-lexer to correctly handle the contextual part) as you cannot just do a textual replacement due to ambiguity.


The class vs className breaks every css style.


It is a macro ("syntactic sugar") for JavaScript, not HTML.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: