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

V3 NavBar not updated

Open NISUSIN opened this issue 7 years ago • 6 comments

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

NISUSIN avatar Oct 16 '19 00:10 NISUSIN

topBar not updated and event componentDidAppear not fired too, maybe a way where to search.

NISUSIN avatar Oct 16 '19 09:10 NISUSIN

hey guys, any update on this?, my boss will kill me if I show him this bug on application.

alpamys-qanybet avatar Oct 18 '19 13:10 alpamys-qanybet

Same effect with open drawer, close drawer and change tabs instant, didAppear event not fired on new screen.

NISUSIN avatar Oct 18 '19 16:10 NISUSIN

V1 was great, V2and3 are some kind of mess with JS.

alpamys-qanybet avatar Oct 18 '19 21:10 alpamys-qanybet

@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){
	        }
	      });

NISUSIN avatar Oct 19 '19 10:10 NISUSIN

Going to close this as it's a duplicate of: #4405

ItsNoHax avatar Nov 08 '19 08:11 ItsNoHax