title: Pass navigation params to second screen component state react navigation
body: <p>I am navigating from screen A to B with a params of object using the react navigation life cycle method <code>onWillFocus</code> and I need after navigating to screen and <code>onWillFocus</code> fire to set the <code>payload.state.params</code> to the component state.</p>
  
  <p>I tried it but state return undefined, how might I use life cycle to fetch sent params and use that saved params to fetch data from API in the same component life cycle. and save it to the state to use it in that new screen.</p>
  
  <p>my render function:</p>
  
  <pre><code>render(){
      &lt;navigationEvents
          onWillFocus={payload =&gt; this.getSessionData(payload)}
      /&gt;
  }
  </code></pre>
  
  <p>the function it calls:</p>
  
  <pre><code>getSessionData = (session_data) =&gt; {
      const session = session_data.state.params;
      this.setState({
          session_data: {...this.state.session_data, session}
      });
      console.log(this.state.session_data);
  }
  </code></pre>