0Pricing
React Native Academy · Lesson

Reading and Writing with AsyncStorage

Install @react-native-async-storage/async-storage, use setItem and getItem to store and retrieve string values, and handle the returned Promises correctly.

What Is AsyncStorage?

AsyncStorage is React Native's persistent key-value storage system. It stores data as strings on the device's local file system, making it available even after the app is closed and reopened. It works on both iOS and Android and supports any string-serializable value. All operations are asynchronous and return Promises, so you must await them or chain .then().

Installing the Package

The community AsyncStorage package must be installed separately in modern React Native and Expo projects. It is no longer bundled with React Native core. Use npx expo install (instead of plain npm) so Expo picks the compatible version for your SDK.

npx expo install @react-native-async-storage/async-storage

All lessons in this course

  1. Reading and Writing with AsyncStorage
  2. Storing and Parsing JSON Objects
  3. Building a Persistent Settings Screen
  4. Clearing Storage and Migration Strategies
← Back to React Native Academy