3 ms·
> If I look at your library, it seems to me like it requires a much more complex mental model to begin to use. How so? It has two functions: (1) createElemen
by jeswin 2y ago
> If I look at your library, it seems to me like it requires a much more complex mental model to begin to use.
How so?
It has two functions:
(1) createElement(jsx):
Allows you to use JSX to write HTML markup. Returns Virtual Nodes.
(2) applyDiff(parent, vNodes):
Merges Virtual Nodes created with JSX into the real DOM efficiently.
This is all you need to know. I can keep it simple because I am not doing much in the library. I felt that if I stayed close to the standards, I wouldn't need to do much.
- BoorishBears 2y agoMaybe you have the luxury of users who want applications that have all the reactivity of a DMV form, but in my apps at some point I'll need the very simple priciple of "do something complex when this value changes" and reimplement useState/useEffect in an ad-hoc manner anyways. I'm more of a backend/embedded developer than a web developer and I still honestly don't get how people find useState/useEffect as intimidating as your comment makes them out to be.