0
Follow
2
View

AsyncStorage issue in react native expo

leila0329 注册会员
2023-01-25 08:57

in your ToyDetails.js while saving is empty. i changed to name and able to get it on https://snack.expo.dev/7ozHrsOBT check ToyDetails.j file

const addCart = async() => {
    setButtonText('ADDED TO CART!')
    try {
      console.log("savedName",savedName) //saved name is empty here 
      await AsyncStorage.setItem('saved_name', name)
    }catch(error){
      console.log('setitem didnt work')
    }
  }

About the Author

Question Info

Publish Time
2023-01-25 08:57
Update Time
2023-01-25 08:57