Client-side data persistence is often crucial to a great mobile experience: remembering a user's preferences and credentials, and showing data immediately when the app starts, instead of showing a spinner while fetching data remotely.
Generally, there are two ways to persist data on the client:
- The built-in
AsyncStorageAPI, or libraries wrapping it
Common options for client-side persistence
|Redux Persist||If you're using Redux, consider using Redux Persist, a library for automatically persisting the state of your Redux store to |
|Realm||The Realm library uses a custom database, written from scratch in C to be compatible on both iOS and Android. We already mentioned Realm under Data Management, but if you're using Realm for managing your data, you get persistence for free!|
Let's look at an example using
Want to learn React Native in-depth?