Y
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
RodgerTheGreat
1798 days ago
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.
link
reilly3000
1798 days ago
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.
link
username91
1798 days ago
That's a fair point!
link
you can get pretty darn close to the react version of this example using vanilla js.