DEV Community

Discussion on: NextJS With Redux

Collapse
 
chandelieraxel profile image
Chandelier Axel

Hey !

IMO you almost never need any kind of state managing within your application. It doesn't really matter if it is Next.JS or plain React stuff.

Most of the use cases you may think about can be resolved without it :

  • Display UI changes ? I definitely not recommend it, this is what local component state are meant to do.

  • Share something globally within the app ? There's very few edge-cases, such as an user, or maybe a theme where I would use React.Context

Collapse
 
demkantor profile image
demkantor

While I agree context has come a long way and can now be used for global state management in many cases there are times that redux is the better solution. It all depends on the project.
Before I begin a project I go over the pros and cons of redux or context or nothing at all.
My last major next.js project I went with context, the prior one nothing, the one before that redux... Overall I'd say I use nothing or redux the most that is purely due to the types of projects I was doing.

Is redux worth learning? Mostly yes. Yes it needed? Depending on the project it will make life way easier or it will just add boilerplate and complications, only way to know is to learn it. And for learning I really recommend their docs, they are fantastic as far as docs go

Collapse
 
thomasskk profile image
thomasskk

If you use Redux Toolkit there is almost no boilerplate. Its simply redux but better.