3 ms·
> implements efficient rendering on top of the DOM diff Here your definition of React diverges from reality, I believe. React does implement state management—
by strogonoff 2y ago
> implements efficient rendering on top of the DOM diff
Here your definition of React diverges from reality, I believe.
React does implement state management—it sort of has to to be of any use. It is a flavour of immediate mode GUI, and some way of managing what changes and what does not change between renders is necessary.
However, React famously does not know about DOM or even Web. (Unless you meant DOM in some more general sense?) People use React to make command-line interfaces, output to embedded LCD screens, etc.
Yes, coupling it to Web and DOM and abandoning the separation of concerns that makes core React so general-purpose could probably make React a bit smaller, but I think projects like Preact are welcome to do it instead.
- nine_k 2y agoMakes sense: React itself is independent from a particular rendering method. There's react-dom that does the DOM rendering. I was trying to point at the fact that rendering occurs on top of state management, as opposed to saying that "React is a rendering library".
- strogonoff 2y agoYou are right, and my calling it imGUI is a stretch since actually it does rely on state to know when to render. If you think about it, the end goal is rendering, and React facilitates that, but the actual rendering (as in, changing page DOM, terminal buffer, etc.) happens outside of React. So my definition may need to be adjusted. I still think it’s a stretch to call React a framework, though!