import AsyncStorage from "@react-native-async-storage/async-storage"; import {Theme} from "@react-navigation/native"; export const storeTheme = async (theme) => { try { const jsonValue = JSON.stringify(theme) await AsyncStorage.setItem('@theme', jsonValue) console.log("theme stored") } catch (e) { console.log(e); } } export const getTheme = async () => { try { const jsonValue = await AsyncStorage.getItem('@theme') return jsonValue != null ? JSON.parse(jsonValue) as Theme : null; } catch(e) { console.log(e); } }