Hey All
I’m working on React-native and Firestore. To add the data in the firestore the following is the code
componentWillMount() {
AsyncStorage.getItem("logid").then((value) => {
this.setState({"logid":JSON.parse(value) });
}).done();
firebase.firestore().collection('mainmhealthdata').doc(this.state.logid).set({
insta: 0
})
I’m storing the logid in AsyncStorage and getting it into another screen in componentWillMount(). The above code for firestore is working fine on click events only but for react-native life cycle components its not working and the following error occurs:
Can anyone please help me out?
Thank you in advance