-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Recommend zustand for global state management #715
base: main
Are you sure you want to change the base?
Conversation
MalcolmTomisin
commented
Sep 13, 2024
- Zustand has a similar API to Redux (Selectors etc)
- Way less boilerplate
- Growing popularity as Redux's gets limited to legacy codebases
- New projects get set up with new generation state managers (Tanstack-query, Valtio, MST, Zustand)
- Zustand is lighweight, lightweight is important for React Native
- Performant with transient updates that don't cause re-renders
Is the mobile team using Zustand a lot? I've never worked with it. I'd love to see how we're using it on our client work. |
@pangolingo I don't think there has been opportunities to experience Zustand on client work. New projects are more likely to use zustand. |
I suggest that we convert this PR to a draft, and don't merge until until more thoughtbotters have enough first-hand experience to recommend Zustand over Redux. |
Hi @pangolingo, yeah I like that suggestion. Ideally, we should get more experience with Zustand and adoption on client projects before changing the guide. @MalcolmTomisin I really liked the idea of writing a blog post about comparing both. |
React Native apps package all code into a single bundle which means the impact on lightweight library is very minimal.
I'm ready to be on the side of redux with this and fight you :)
We use Ruby on Rails as our web stack which is 20 years old, stable and just works. While we should focus on adopting modern solutions, instead of chasing them, we should be carefully choosing them. I think we should be introducing new libraries in a client project first to test suitability, identify problems, and gather team feedback before recommending broader adoption such as updating our guides. |