DEV Community

Discussion on: NextJS With Redux

Collapse
 
merichard123 profile image
Richard • Edited

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 ๐Ÿ€

Collapse
 
talr98 profile image
Tal Rofe • Edited

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...)

Thread Thread
 
merichard123 profile image
Richard

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.

Collapse
 
gomandev profile image
Gomandev

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.

Thread Thread
 
merichard123 profile image
Richard

Sweet!! I'll have a look at that. Thank you!!