NextJS developers: what do you use for state management? (if anything)

I've only somewhat recently discovered NextJS after developing with React for quite some time. I really love it!

So far, on the small apps that I've build with NextJS so far I haven't really needed any real state management, but now with my current project which is a bit bigger, I think I'm hitting a point where I might need to manage state a bit better.

I used Redux heavily in the past, and wish to avoid touching it ever again if I can help it. I've recently also discovered PullState which is really nice so far.

What do you use?

Phil

I have never needed to much complex state management somehow. Never really understood why anyone would. Maybe i'm missing something :D Whats a use case?

0 Likes
Shane Author

@strange_quirks In fairness I think for many cases you probably don't need it. In my case, it's helping me with some client-side reactivity stuff. ie. added an item to a list via API, and as it returns successful, I need something in a different part of the UI to update. You could achieve the same thing in a few ways, but the easiest/cleanest I think is to use something to managing the state of those things 👍🏼

0 Likes
Bao D

@strange_quirks Agree on this point. I used to like easy-peasy (redux behind the scenes) because it worked so well with typescript, but then found out the app did not need much global state. Only use React context (with hooks) for now.

0 Likes

@strange_quirks The main reason you would use it is if you have a complex application with many pieces of state shared by multiple areas. By having a state management solution it means when you update the state then all the places that share the state would be updated instead of them becoming out of sync.

0 Likes

MobX always won the battle for me.

0 Likes
Matthieu H.

For https://budg.co I’m using react-query for local states (blitzjs behind the scene) and useReducer in a react provider for global states.

0 Likes
Umar Luqman

@matthieuh +1 for Blitz

0 Likes
Alex

unstated-next (https://github.com/jamiebuilds/unstated-next). The tagline is "200 bytes to never think about React state management libraries ever again" and literally I haven't had to think about state management in over a year since I found it.

0 Likes
Shane Author

@AlexBH_ That is a very strong value proposition 😂 Thanks I'll check it out

0 Likes

Please sign in to leave a comment.