Search code examples
react-nativewix-react-native-navigation

How to pass the parameter with pop in wix react-native-navigation?


how to pass parameters in pop method.

Requirement: There are two screens, screen 1 has two tabs like this: Address and Billing. There are two button on each tab layout. On click button go to screen 2 after functionality back to screen 1 but now which tab is active. If go to address tab so back to address tab same as billing tab.

Tell me how to do it?


Solution

  • You can pass callback while pushing screen like

    Navigation.push(this.props.componentId, {
      component: {
        name: "Your.ScreenName",
        options: {
          callback:this.yourCallBackFun
        }
      }
    });
    

    Now while pop you can call that function like

    this.props.callback();
    Navigation.pop(this.props.componentId);
    

    I think it will help you.