title: React Native Navigation override goBack() of header back button in Stack Navigator
body: <p>I want to customize the behavior of the default back button in stack navigator locally to one screen.</p>
  
  <p>In the details assuming that on the stack there are screen1|screen2, I want to pass some props from screen2 to screen1 once the button is pressed. </p>
  
  <p>I spent a lot of time reading React navigation docs, searching on internet and coding but I am not able to do this.</p>
  
  <p><strong>FROM DOCS</strong></p>
  
  <p><em>It's possible that in some circumstances that you want to customize the back button more than you can through the options mentioned above, in which case you can set the headerLeft option to a React Element that will be rendered
  I know that the issue concerns the goBack() function of the headerRight component.</em> </p>
  
  <p>I want to override the default function goBack() related to the headerLeft back button  with something like navigation.navigate("previousScreen",{{..props}}). </p>
  
  <p>And ( this is very important!! ) I want to use this behavior locally to a specific screen, so not globally.</p>
  
  <p>I have tried with something like this but doesn't works.</p>
  
  <pre><code> export default function App(){
   return(
   &lt;NavigationContainer&gt;
    &lt;Stack.Navigator&gt;
      &lt;Stack.Screen name="FirstScreen" component={FirstScreen}/&gt;
      &lt;Stack.Screen name="SecondScreen" component={SecondScreen} options={{headerLeft: () =&gt; (
          &lt;HeaderBackButton
            onPress={() =&gt;navigation.navigate("FirstScreen",{//stuff//})}
            title="Info"
            color="#fff"
          /&gt;
        ),}}/&gt;
    &lt;/Stack.Navigator&gt;
  &lt;/NavigationContainer&gt;
   )}
  </code></pre>