Warm tip: This article is reproduced from stackoverflow.com, please click
react-native wix-react-native-navigation

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

发布于 2020-04-03 23:19:31

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?

Questioner
Harleen Kaur Arora
Viewed
168
Nimesh Bhalani 2019-12-10 17:00

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.