title: How to get previous route name from React Navigation
body: <p>I am trying to get previous route name to my current screen. Because based on the previous screen name, I have to show/hide few objects in current screen.</p>
  
  <p>To get previous screen name, I have tried following</p>
  
  <pre><code>componentDidMount() {
      const { navigation } = this.props;
      if (navigation.state.params &amp;&amp; navigation.state.params.previous_screen) {
         console.log('navigation.state.params.previous_screen', navigation.state.params.previous_screen);
      }
  }
  </code></pre>
  
  <p>But, It's getting <code>undefined</code> in console log.</p>
  
  <p>Any suggestions?</p>