Hacker News new | ask | show | jobs
by username91 1798 days ago
It seems deceptive to me to compare using createElement etc. to JSX, rather than using innerHTML, or a <template>.
2 comments

likewise, using an unnecessarily repetitive style in the "vanilla" version and using a few compact ternaries in the "react" version.

you can get pretty darn close to the react version of this example using vanilla js.

I think that was mostly for illustrative purposes. Most websites aren’t built like that, but it helps show how attributes on DOM objects can be manipulated before throwing the reader into React state concepts.
That's a fair point!