logoalt Hacker News

darepublicyesterday at 7:43 PM1 replyview on HN

React is just JavaScript. Also vanilla JavaScript is just JavaScript


Replies

dasherswyesterday at 7:50 PM

React has its own idioms like hooks, and virtual DOM operations. A developer well-versed in JavaScript and who never saw React before wouldn't know how `useState`, or a `Context` would work. They wouldn't know that components would re-evaluate and re-render all the time. They also wouldn't know they shouldn't put useState inside a conditional statement. They wouldn't know they would need a useEffect, or that it depends on an array to declare its dependencies.

Vanilla JS, on the other hand, requires a good knowledge of DOM APIs.

Gea tries to be as close to plain old JavaScript as possible, the way we write it on the backend. The only necessary notion is that everything is reactive and DOM will update automatically as component/store members change.