title: Pass props from Modal to other Component react navigation
body: <p>I use <a href="https://reactnavigation.org/" rel="nofollow noreferrer">react navigation</a>. I have a <code>TabNavigator</code>. Each <code>Tab</code> contains a <code>StackNavigator</code>. From one <code>StackNavigator</code>, it is possible to open a <code>Modal</code>. 
  The <code>Modal</code> is opened when I click on a <code>Button</code> in a certain <code>Component</code>.</p>
  
  <pre><code>export default class CallModalComponent extends Component {
      constructor(props) {
          super(props)
      ...
      }
  
      ...
  
      render() {
      const { navigate } = this.props.navigation;
           return (
                &lt;Button
                 ....
                 onPress={() =&gt; navigate("Modal")}/&gt;
  </code></pre>
  
  <p>The in the <code>TabNav</code> registered screen <code>&lt;MyModal /&gt;</code> is a stateful <code>Component</code>.
  On close of the <code>Modal</code> I need the <code>state</code> of <code>&lt;MyModal /&gt;</code> to be passed down to <code>&lt;CallModalComponent /&gt;</code>.</p>
  
  <p>The problem I am having is how that might work with <code>react navigation</code> in between... I know that I can use <code>redux</code> and send/retrieve it through the <code>global store</code>. But I wonder if its possible with only <code>react native</code>. 
  Any suggestions?</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>I implemented the Code from answer</p>
  
  <pre><code>export default class CallModalComponent extends Component {
      constructor(props) {
          super(props)
      ...
      }
  
      ...
      onModalDismis(childVar) {
        console.log('modal is closing');
        console.log(childVar);
      }
      render() {
      const { navigate } = this.props.navigation;
           return (
                &lt;Button
                 ....
                 onPress={(childVar) =&gt; navigate("Modal", {onModalDismis: this.onModalDismis()})}/&gt;
  
  // Then in your modal component
  
  componentWillUnmount () {
      console.log('unmount');
      this.props.navigation.state.params.onModalDismis('here we go');
  }
  </code></pre>
  
  <p>The following gets logged:
  When the <code>Modal Component</code> is mounted I get: </p>
  
  <p><code>modal is closing</code>
  <code>undefined</code></p>
  
  <p>Then, when I actually close the <code>Modal</code>, I get: </p>
  
  <p><code>unmount</code></p>
  
  <p>and then the error:</p>
  
  <blockquote>
    <p>Cannot read property of onModalDismiss of undefined.</p>
  </blockquote>
  
  <p>I expected to be nothing logged on mounting of the <code>Modal</code>. And then, when I close the <code>Modal</code> I expected</p>
  
  <p><code>unmount</code>, <code>modal is closing</code> and <code>here we go</code> to be logged.</p>