V3 NavBar not updated
Issue Description
Navbar is not updated when we pop too fast, on android with the hardware button. Can be reproduce on simulator with timeout
Steps to Reproduce / Code Snippets / Screenshots
Use my repo: https://github.com/NISUSIN/navbarbug
Just push a screen and pop immediatly with back button android, navbar is not updated.
Environment
- React Native Navigation version: 3.2.0
- React Native version: 0.61
- Platform(s) (iOS, Android, or both?): Android
- Device info (Simulator/Device? OS version? Debug/Release?): Both
topBar not updated and event componentDidAppear not fired too, maybe a way where to search.
hey guys, any update on this?, my boss will kill me if I show him this bug on application.
Same effect with open drawer, close drawer and change tabs instant, didAppear event not fired on new screen.
V1 was great, V2and3 are some kind of mess with JS.
@alpamys-qanybet For topBar update, you can use this workaround.
When you push the screen, pass component id, and on your new screen when you unmount it, update the excomponent.
Exemple:
Navigation.push(this.props.componentId, {
component: {
name: 'Collection',
passProps: {
exCompo: this.props.componentId,
},
}
})
And in screen Collection, make this:
componentWillUnmount(){
if(this.props.exCompo == "Profil"){
Navigation.mergeOptions(this.props.exCompo, {
//Make your stuff
});
}
//Or make function like this UpdaterClass.update(this.props.exCompo)
//And in your UpdaterClass, you make your mergeOption
}
It will work, and for drawer bug, if you use bottomTabs, you can use :
//Same effect than DidAppear on bottom Screen
Navigation.events().registerBottomTabSelectedListener(({ selectedTabIndex, unselectedTabIndex }) => {
if(selectedTabIndex == 2){
}
});
Going to close this as it's a duplicate of: #4405