I have an issue in my app at the first time I should choose an item (every item have different period so I countdown) & keep it until the countdown finish so when I logged out then login I don’t lose the data but whenever I close all app screens of my phone I lost the data then I should login & then choose an item again !
const { itemType, setItemType } = useContext(GlobalContext)
const handleValueChange = (itemValue, itemIndex) => setTypeValue(itemValue)
const choosePlant = async () => {
try {
setItemType(typeValue)
await AsyncStorage.setItem('itemType', itemType)
navigation.navigate('x')
} catch (err) {
console.log(err)
}