react-native-firestack
react-native-firestack copied to clipboard
[v3] ref.off not firing
if(this.ref) {
console.log("ref exists")
this.ref.off('value', () => {
console.log("off success")
this.props.dispatch(logout())
})
.catch((error)=>{
console.log(error)
})
}
Output: ref exists
For me, I got it to work when I only passed this.ref.off('value')
– no callback. Your code suggests that you're removing the listener that you used for .on()
I think
@alexkendall @abcd-ca I've stopped working on v3 here and moved to my own repo.
.on on the web sdk docs returns the unmodified listener function that you can then pass to off when you want to unsub.