Hacker News new | ask | show | jobs
by s17n 973 days ago
It's how react works, though, and react is absolutely dominant... do you think that's despite the "terrible idea"?
2 comments

I agree they are technically the same, but JSX is miles ahead.

Most HTML is valid JSX, minimizing the mental overhead. JSX has great tooling, and TSX has great type safety.

Just need to point out that "Most HTML is valid JSX" doesn't really sound true to me. Eg, show me a non-trivial HTML web page that doesn't have any `class="..."` attributes (I've managed to avoid doing much React/JSX for the last few years, but I seem to remember that you had to use `className` because `class` is a reserved word in JS).
You are right. I still maintain that JSX<=>HTML is much easier to think about than Go<=>HTML.
No, it doesn’t work like that.