timomeh / react-native-material-bottom-navigation

💅🔧👌 a beautiful, customizable and easy-to-use material design bottom navigation for react-native
MIT License
709 stars 127 forks source link

undefined is not an object (evaluating '_this.refs.pressRipple.run') #42

Closed DavitVosk closed 7 years ago

DavitVosk commented 7 years ago

Hello. Thanks for your package. I receive ""undefined is not an object (evaluating '_this.refs.pressRipple.run')"" error when tab pressing takes me to another page of the app. To note, this page renders properly when I go to it from side menu, so the component is not the problem here.

Please help to solve the problem

timomeh commented 7 years ago

Is the BottomNavigation visible on this page/screen? I guess it could happen that, if you navigate to a screen which isn't using the BottomNavigation, there could be a potential of a crash.

DavitVosk commented 7 years ago

no, the page to be navigated to does not have that TabBar. I solved the problem just with the help of setTimeout... Namely postponing the navigation. But don't sure this is the right way of operation. How the navigation from the same TabBar to different pages (both not using the TabBar) can be different: one succeed, and the another one-not

timomeh commented 7 years ago

The issue is that the BottomNavigation has this circular animation while the screen changes. If you press on the Tab, it switches to the screen and tries to run the animation – but since the BottomNavigation is gone on this screen, it throws an error. If you navigate without using the BottomNavigation, it doesn't trigger the animation, hence there's no error.

That's definitely a bug and something I didn't think of – that the BottomNavigation could be gone on a screen. I try to publish a hotfix in the next days.

DavitVosk commented 7 years ago

ok thanks

timomeh commented 7 years ago

I fixed this issue in v0.5.2 and published it just now 🎉

Please reopen, if this issue still exists. (But I don't think so, I tested it and the error is gone). Sorry for taking so long for this small fix.