1、下载
npm install @react-native-async-storage/async-storage
2、使用 (获取本地存储时需要async/await)
import AsyncStorage from '@react-native-async-storage/async-storage';
//获取
const getMsg=async()=>{
const user=await AsyncStorage.getItem('UserInfo')
}
//存储
AsyncStorage.setItem('token', token);