AsyncStorage @react-native-async-storage/async-storage
import React from 'react'; import AsyncStorage from '@react-native-async-storage/async-storage'; //USER_DATA is example export enum StorageKey { EXAMPLE = 'EXAMPLE', } /** * * @param key 키는 strageKey 참고 * @param data 저장할 데이터 */ export const SaveData = async (key: StorageKey, data: any) => { try { await AsyncStorage.setItem(key, JSON.stringify(data)); } catch (err) { console.log(err); } }; /** * ..
react-native-tool
2023. 6. 28. 11:20