AsyncStorage : React Native

Save 'unique Id' as session variable in react native

You can add the unique id using AsyncStorage like this :

   AsyncStorage.setItem('Key Name', uniqueId)

And after that you can get from other component like this :

   AsyncStorage.getItem('Key Name').then((value) => console.log(value))

For details you can read from the documentation. I hope this answer can help you.

import { AsyncStorage} from 'react-native';
AsyncStorage.getItem('Key Name').then((value) => console.log(value))

we can get value from asyncstorage in any component of app.

number of another function are used like merge,remove etc.please see documentation

Comments

Popular posts from this blog

React-native : Unable to use react-native-fast-image

react-native vs reactXP

reinterpret_cast bug or UB? [duplicate]