I made localstorage in ReactJS that works well.
But I want to use this code to React-native.
I am confused how I can apply to
This code is of ReactJs.
...
componentWillMount(){
const contactData = localStorage.contactData;
if(contactData){
this.setState({
contactData:JSON.parse(contactData)
})
}
}
...
...
componentWillMount(){
const contactData = localStorage.contactData;
if(contactData){
this.setState({
contactData:JSON.parse(contactData)
})
}
}
...
I read this "https://facebook.github.io/react-native/docs/asyncstorage.html"
But I don't understand well.