TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Ask HN: What are the best alternatives to MobX for front-end state management?

2 pointsby sheerunover 2 years ago
I left Redux camp the year it was created due to high complexity of apps created with it, and switched to MobX which employs more mutable&#x2F;reactive approach, which I found quite fast to use and surprisingly manageable.<p>I wonder if there exist now better alternatives? What do you recommend?

3 comments

matthewwolfeover 2 years ago
My favorite approach is Zustand, which is a simplistic object with data and functions to update that data, combined with react-query for doing a lot of the data fetching. Zustand is super simple and based around hooks, and I find that with a data fetching library that handles caching, I have a lot less “global” state than in the past. IMO for even relatively complex apps, having a ton of global state is not great, and breaking things down into specific contexts that are each separate hooks is great. I think Redux’s Toolkit or whatever it’s called works similarly.
solardevover 2 years ago
For simpler to moderate complexity, you might be able to get away with just the built-in useState and useContext hooks together.<p>You can wrap your whole app in a context provider, and&#x2F;or combine it with state trees that only certain features or components or users need. Then any child within any tree can pull from the contexts.<p>It&#x27;s up to you whether you want to use a reducer like pattern, or make the setter itself available in the context so any consumer can mutate state, or pass along a helper function that sets state as an abstraction.<p>Any way you do it, it will be far easier to use than the nightmare that is Redux. It might be more disorganized, with a lot of separate state hooks, but each one can be relatively modular. Overall I found it waaaaaay easier than Redux.
评论 #33299586 未加载
rtcomsover 2 years ago
I like to use KeaJs, which is built on top of Redux<p><a href="https:&#x2F;&#x2F;keajs.org&#x2F;" rel="nofollow">https:&#x2F;&#x2F;keajs.org&#x2F;</a>