Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

react native asyncstorage setItem example

setObjectValue = async (value) => {
  try {
    const jsonValue = JSON.stringify(value)
    await AsyncStorage.setItem('key', jsonValue)
  } catch(e) {
    // save error
  }

  console.log('Done.')
}
Source by react-native-async-storage.github.io #
 
PREVIOUS NEXT
Tagged: #react #native #asyncstorage #setItem
ADD COMMENT
Topic
Name
2+1 =