News for hackers. Stuff that matters.
Re:React's UseRef Deep Dive by BreakfastB0b on Thursday December 17, 2020 @04:07AM (#25453902)

  You can write global reactions to state changes very easily.
This is exactly the problem, shared mutable state leads to "spooky action at a distance". It results in causal connections between parts of your codebase that are not reflected in the control flow of your code. If you have immutable unidirectional data flow causal relationships between parts of your code base must be reified in the control flow of the language.

  Most components do not have any async effects.
At least when using Apollo / GraphQL almost every component ends up with async effects.

I think this talk by Andre Staltz is the best explanation and solution of the problem https://www.youtube.com/watch?v=SXdtrhn8iII

Re:React's UseRef Deep Dive by knuthsat on Thursday December 17, 2020 @05:00AM (#25454164)
But the state is not mutable, the state is inside a React.Context that provides functions that manipulate it. It's practically the same as redux. You still need to have async actions with redux and use these actions.

mobx on the other hand is exactly that, the state is globally mutable, anyone can import it from anywhere to anywhere.