I am using react native navigation v2 by wix. I have a welcome screen with login screen and register. I start the startAuth.js from App.js
. There are two tabs with login and register.
But as soon as app starts the componentWillMount methods runs in the register screen but yet i am at login tab.
Why is this happening?
react-native-navigation
's Tab does not support lazy loading. But there are two special lifecyle functions where you can put your logic when component appear or disappear on screen
componentDidAppear()
: called each time this component appears on screencomponentDidDisappear()
: called each time this component disappears from screenhttps://wix.github.io/react-native-navigation/docs/screen-lifecycle
There is also a discussion about topic https://github.com/wix/react-native-navigation/issues/1250