2 ms·
A large mistake in React's history is definitely it's history with redux and any API like it. You can see that it's very quickly being shed away from React in t
by rhacker 6y ago
A large mistake in React's history is definitely it's history with redux and any API like it. You can see that it's very quickly being shed away from React in these charts which I'm very happy about. Redux is like a global variable and it's painful and clumsy.
- Silhouette 6y agoThe big problem with traditional global variables is the way any code can change them arbitrarily, making it near impossible to understand the state management in a large program. I would argue that a library like Redux on the front end is more like a database, in that while it can be accessed from anywhere, in reality there is a structure to interacting with it and there has to be an explicit intention to modify the current state, which can been found via tools or even just a grep of the source code.
- williamdclt 6y ago> Redux is like a global variable This meme needs to die. You can argue that it's painful and clumsy, but not that it's "like a global variable". The _whole_ point of redux is to offer global state without the problems of global variables. Interacting with the global state through actions, selectors and subscribers prevents the problems of global variables. Is it clumsy/verbose/confusing/whatever? There's definitely arguments for it. But people stop thinking when they see the word "global" and make terrible arguments against Redux.