State manager for a realtime chat app?

Im developing a react native chat app. What state manager would you recommend? I've tried redux and valtio, and both seem fitting for this. There will be multiple active chats, group chats, and realtime messaging, so the state will be somewhat complex and dynamic. Whats your thoghts? ^^ Thanks in advance!
12 Replies
whatplan
whatplanβ€’16mo ago
all of the poimanders options are really well made and documented its more of a personal preference thing I really like jotais atomic way of doing things they have a comparison to zustand on their site: https://jotai.org/docs/basics/comparison#how-is-jotai-different-from-zustand
Jotai
Comparison β€” Jotai, primitive and flexible state management for Rea...
Jotai takes a bottom-up approach to global React state management with an atomic model inspired by Recoil. One can build state by combining atoms and renders are optimized based on atom dependency. This solves the extra re-render issue of React context and eliminates the need for memoization.
Gaden
Gadenβ€’16mo ago
I've tried jotai before. It just seemed to me, it was more suited for just sharing small simple states across components, to prevent prop drilling. Do you think it will be fitting for multiple realtime updating chats, and group chats? Maybe i've misunderstood how im supposed to use it
whatplan
whatplanβ€’16mo ago
Both jotai and zustand/redux are capable of modeling advanced state systems. It’s all about how you want to manage that state. The link I sent goes over the differences in approach
Gaden
Gadenβ€’16mo ago
From what im reading, zustand looks better than jotai for my app
Lois
Loisβ€’16mo ago
I also saw people use MobX in react-native apps
Gaden
Gadenβ€’16mo ago
It will have one center pointer, where all the messages from the server comes in realtime, and it need to change a bunch of different components based on the messages WIll take a look at it!
Lois
Loisβ€’16mo ago
GitHub
GitHub - infinitered/ignite: Infinite Red's battle-tested React Nat...
Infinite Red's battle-tested React Native project boilerplate, along with a CLI, component/model generators, and more! - GitHub - infinitered/ignite: Infinite Red's battle-tested Re...
Gaden
Gadenβ€’16mo ago
I ended up using zustand Loving it so far
Gaden
Gadenβ€’16mo ago
Im using it along with this template here https://github.com/t3-oss/create-t3-turbo/
GitHub
GitHub - t3-oss/create-t3-turbo: Clean and simple starter repo usin...
Clean and simple starter repo using the T3 Stack along with Expo React Native - GitHub - t3-oss/create-t3-turbo: Clean and simple starter repo using the T3 Stack along with Expo React Native
Lois
Loisβ€’16mo ago
Yeah the Inifinite Red guys tend to build things that consider global scaling (ex: taking care of the language problem) and it can be too monolithic to look at t3-turbo is goated but it can be a good reference to check how comprehensiveness look like
Wezter
Wezterβ€’16mo ago
@gaden I would recommend you take a look at legend state, it's the one I am most interested in trying out properly myself. If you want something properly battle tested then Redux and MobX are probably your best bet (Infinite Red uses MobX for their projects iirc). Valtio, Zustand and Jotai are also really nice πŸ™‚
Gaden
Gadenβ€’16mo ago
I went with zustand, and is liking it so far πŸ™‚
Want results from more Discord servers?
Add your server