I am creating React Native App for mobile on Expo. When we try to make mobile Apps, we should usually manage state in this app. However, I am using Expo. Of course, Expo is useful to start React Native App easily and quickly but sometimes Expo cannot accept modules.
So, in this case, I tried to use Realm to manage state but Expo can't follow this.
Could you teach me which way for state management is better in React Native on Expo?
There's a few ways to go about this, two of which I know and have used:
AsyncStorage
: This is default with react-native
and you won't need to install anything to use it, here's a few tutorials and documentation on it.
React-Redux
: This is something I use a lot more, it utilises AsyncStorage
but allows you to create a better storage flow and a system of persisting data so when you close the app and reopen it, the data will still be there. I've found React-Redux
to be a lot easier once properly learned, here's a few documentations on it.
A quick google search on either (react native using react redux
or react native using async storage
) will give you quite a few documentations/tutorials that is quite useful and you always have Stackoverflow, if you're ever stuck.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With