DEV Community

Discussion on: Redux is half of a pattern (1/2)

 
luiz0x29a profile image
Real AI

They talk about Single root of "thruth", but the elephant in the room is the insidious internal mutable state on every React component that's not pure and/or has hooks.

Wasn't the entire point of modelling state/events/transitions knowing when to do actions, like rendering the screen.

So if there was a proper way of doing virtual finite state machines, you wouldn't need react to reconcile the three, you could just go and change the DOM directly with impunity.

The DOM would be the single source of truth for the visual representation of the applications, and it wouldn't be slow because you wouldn't be randomly poking and mutating it without reason.
It would actually be faster, as it would only change precisely in "reaction" to state+events, ironic for something called "React" that doesn't react to anything, it should be called Render.