react-native-admob icon indicating copy to clipboard operation
react-native-admob copied to clipboard

property is null in interstitialDidClose

Open tuxtux00 opened this issue 10 years ago • 1 comments

Hi there,

I am having a strange problem and I hope someone will be able to help me.

I am using a ScrollView that should scrollTo an X coordinate on interstitialDidClose. It works fine when the component mounts for the first time. As soon as I leave the scene (react-native-router-flux) and the component unmounts, this behavior doesn't work anymore and I get an error message saying that the property (this.scrollView) is null. If I do a console.log, the property is not null and actually contains the ref to my scrollview.

here is a gist https://gist.github.com/tuxtux00/63d654a8c7553eb93abd99a4d46b8632

library that I am using react-redux react-native-router-flux

Thanks in advance for your help folks.

tuxtux00 avatar Nov 04 '16 17:11 tuxtux00

My bad, forgot to call removeEventListener on componentWillUnmount. This solved my bug

tuxtux00 avatar Nov 11 '16 13:11 tuxtux00