I use React Native Firebase for working with Firebase. In redux action I have:
export const startAction = (item) => {
return (dispatch) => {
firebase.database().ref(`/users/${firebase.auth().currentUser.uid}/some/`)
.push(item).then((snapshot) => {
console.log('Added to firebase', snapshot, snapshot.key);
}).catch((err) => { console.log('errooooor', err) });
}
}
In then() I should get snapshot of inserted data, but I get null. How is that possible?
Error text: Cannot read property 'key' of null