AsyncStorage

React Native 6 min min read Updated: Aug 03, 2026 Beginner
AsyncStorage
Beginner Topic 1 of 15

AsyncStorage

AsyncStorage is a simple, asynchronous, key-value storage system used in React Native to persist small amounts of data locally on the device, such as user preferences or authentication tokens.

Installing AsyncStorage

bash npm install @react-native-async-storage/async-storage

Storing Data

javascript import AsyncStorage from '@react-native-async-storage/async-storage'; await AsyncStorage.setItem('username', 'JohnDoe');

Reading Data

javascript const username = await AsyncStorage.getItem('username'); console.log(username);

Storing Objects and Arrays

Since AsyncStorage only stores strings, objects and arrays must be converted using JSON.stringify before saving and JSON.parse after retrieving.

javascript await AsyncStorage.setItem('user', JSON.stringify({ name: 'John', age: 25 })); const user = JSON.parse(await AsyncStorage.getItem('user'));

Removing Data

javascript await AsyncStorage.removeItem('username');

Clearing All Data

javascript await AsyncStorage.clear();

Getting Multiple Keys at Once

javascript const values = await AsyncStorage.multiGet(['username', 'theme']);

Limitations of AsyncStorage

AsyncStorage is not encrypted, not ideal for storing large amounts of data, and can be slower than alternatives like MMKV for apps requiring frequent, high-performance storage access.

Conclusion

AsyncStorage remains a simple and widely used solution for persisting small pieces of data in React Native applications, though performance-critical or sensitive data may benefit from alternative storage solutions covered in later tutorials.

Get Newsletter

Subscibe to our newsletter and we will notify you about the newest updates on Edugators