title: How to continue the execution of parent function after redirecting to and from the child / grand child page - React native
body: <p>I am a newbie to React Native and also not so strong in JS, so kindly bare with me and help me out in this scenario.</p>
  <p>I have a page A. When on clicking a switch it triggers some function(s), Lets say like</p>
  <p>Parent Page A - <em><strong>enableInsurance</strong></em></p>
  <pre><code>function switch(insuredID){
     if (noCreditCard){
       navigator.navigate('paymentPage',{navigateKey:&quot;ObjectsDetailPage&quot;}); //Takes user to payment page to choose payment mode
     }
     
     /* On re-navigation after adding CreditCard I need to continue doing below lines */
     object.isInsured = true;
     const { updateAction } = this.props;
     updateAction();
     this.setState({ showFlatrateText: false });
  }
  
  </code></pre>
  <p>In our scenario there is no credit card so the user is navigated to <em><strong>paymentPage</strong></em> where he can select mode of payment like Card, paytm, etc.</p>
  <pre><code>goToPaymentWebview = (Type) =&gt; {
    NetInfo.fetch()
      .then(resp =&gt; { 
         if(resp.isConnected){
              this.setState({showNetDownModal:false});
              NavigationService.navigate('paymentWebview',{navigateTo: this.props.navigation.getParam('navigateKey'));
          } else {
              this.setState({showNetDownModal:true});
          }
       });        
    }
  </code></pre>
  <p>After selecting the mode the user is taken to grand Child page - <em><strong>paymentWebview</strong></em> and load in webview.</p>
  <p>Once the user fills the details and submits, then I navigate the user back to the <em>Parent Page A</em> on the success or failure callback of the detail submission in webview as below</p>
  <p>Grand Child Page - <em><strong>paymentWebview</strong></em></p>
  <pre><code>if(respJSON.status === 'success') {
     const { navigate } = this.props.navigation;
     setTimeout(() =&gt; {
        switch(this.state.navigateTo){
           case &quot;ObjectsDetailPage&quot;:
               navigate('enableInsurance');
           break;
           case &quot;ObjectPage&quot;:
               navigate('ObjectPageScreen');
           break;
           default:
               navigate('Second',{ccUpdate: respJSON});
         }
      }, 2000);
   }
  </code></pre>
  <p>Now I am back to the page from where I got redirected to payment page using <em>navigateKey</em> param,
  In our case its Parent Page A - <em>enableInsurance</em></p>
  <p>But after navigating back here how can i execute the same <em>function switch(insuredID){ ... }</em>  and proceed with the functionality</p>
  <ul>
  <li>React-Native 0.63.4,</li>
  <li>React-navigation 4.x,</li>
  </ul>
  <p>Creating app for both iOS and Android, navigation is using Stacknavigator , there is no tab navigation.</p>