5 ms·
It seems deceptive to me to compare using createElement etc. to JSX, rather than using innerHTML, or a <template>.
by username91 5y ago
It seems deceptive to me to compare using createElement etc. to JSX, rather than using innerHTML, or a <template>.
- RodgerTheGreat 5y agolikewise, 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.
- reilly3000 5y agoI 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.
- username91 5y agoThat's a fair point!