Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

react native asyncstorage getItem example

getMyObject = async () => {
  try {
    const jsonValue = await AsyncStorage.getItem('@key')
    return jsonValue != null ? JSON.parse(jsonValue) : null
  } catch(e) {
    // read error
  }

  console.log('Done.')

}
Source by react-native-async-storage.github.io #
 
PREVIOUS NEXT
Tagged: #react #native #asyncstorage #getItem
ADD COMMENT
Topic
Name
8+7 =