Module 02 · Lesson 05
Saving data on the device
AsyncStorage for simple data, a backend when you need sharing.
Build screens6 min
npx expo install @react-native-async-storage/async-storage
import AsyncStorage from "@react-native-async-storage/async-storage";
await AsyncStorage.setItem("cart", JSON.stringify(items));
const saved = JSON.parse((await AsyncStorage.getItem("cart")) ?? "[]");