I agree redux is a lot of boilerplate code and to be honest you don't need redux. Lots of companies will be using redux but context will do just fine in most if not all cases.
I attempted to learn redux at one point but it was just too much for such basic tasks, I use a package called Zustand instead you'll find that things like this work just fine in all circumstances.
If you have started learning redux you can have a look at Easy Peasy it's a more simplified version :)
There is no "You don't need redux". Because you do need it. Actually, I don't see any reason not to use redux over ReactContext.
The reason is simple, and I won't even explain:
My personal summary is that new context is ready to be used for low frequency unlikely updates (like locale/theme). It's also good to use it in the same way as old context was used. I.e. for static values and then propagate updates through subscriptions. It's not ready to be used as a replacement for all Flux-like state propagation.
The best way to go about anything is just to use whatever you are comfortable with. If redux is the right solution for you then I'm not judging. Oftentimes redux is way too bloated and simpler replacements are much easier to implement and achieve the same task. Even when context won't work for example for state subscriptions like you said tools like Zustand allow for subscribing to state there is no need to reach for bloated tools like redux.
Redux is not the only solution to the forever expanding problem of state management. Hence I stand but it you don't need redux, however if you are comfortable with it by all means use it. I'm just saying you don't have to learn redux because all the "cool kids" are using it.
No matter how you try to run away from redux, redux is still the rockstar state management tool. But they are a new tool for redux that simplify stuff. We now have Redux Toolkit (redux-toolkit.js.org/). You might wanna check out. Cheers.
I agree redux is a lot of boilerplate code and to be honest you don't need redux. Lots of companies will be using redux but context will do just fine in most if not all cases.
I attempted to learn redux at one point but it was just too much for such basic tasks, I use a package called Zustand instead you'll find that things like this work just fine in all circumstances.
If you have started learning redux you can have a look at Easy Peasy it's a more simplified version :)
Good luck ๐
There is no "You don't need redux". Because you do need it. Actually, I don't see any reason not to use redux over ReactContext.
The reason is simple, and I won't even explain:
My personal summary is that new context is ready to be used for low frequency unlikely updates (like locale/theme). It's also good to use it in the same way as old context was used. I.e. for static values and then propagate updates through subscriptions. It's not ready to be used as a replacement for all Flux-like state propagation.
This was being said by React member (github.com/facebook/react/issues/1...)
The best way to go about anything is just to use whatever you are comfortable with. If redux is the right solution for you then I'm not judging. Oftentimes redux is way too bloated and simpler replacements are much easier to implement and achieve the same task. Even when context won't work for example for state subscriptions like you said tools like Zustand allow for subscribing to state there is no need to reach for bloated tools like redux.
Redux is not the only solution to the forever expanding problem of state management. Hence I stand but it you don't need redux, however if you are comfortable with it by all means use it. I'm just saying you don't have to learn redux because all the "cool kids" are using it.
No matter how you try to run away from redux, redux is still the rockstar state management tool. But they are a new tool for redux that simplify stuff. We now have Redux Toolkit (redux-toolkit.js.org/). You might wanna check out. Cheers.
Sweet!! I'll have a look at that. Thank you!!