title: Is it possible to pass the goBack() function as a parameter
body: <p>I have a function AccountScreen. From this screen I would like to be able to <code>navigate.goBack()</code>. I tried following the guide <a href="https://reactnavigation.org/docs/navigating/" rel="nofollow noreferrer">here</a> on how to go back to a previous screen but I am getting an error.</p>
  
  <p>Here is my code:</p>
  
  <p>AccountScreen.js</p>
  
  <pre><code>const BackButton = styled.Button`
  
  `;
  
  
  function AccountScreen({doThis}) {
      return(
          &lt;Root&gt;
              &lt;BackButton title="" onPress={() =&gt; doThis} /&gt;
              &lt;Text&gt;Account&lt;/Text&gt;
          &lt;/Root&gt;
      )
  };
  
  export default AccountScreen;
  </code></pre>
  
  <p>navigations.js</p>
  
  <pre><code>const createProfileDrawer = ({navigation}) =&gt; 
              &lt;Drawer.Navigator&gt;
                  &lt;Drawer.Screen name="Profile" component={ProfileScreen}/&gt;
                  &lt;Drawer.Screen name="Account" 
                  component={AccountScreen(navigation.goBack())} /&gt;
              &lt;/Drawer.Navigator&gt;
  </code></pre>
  
  <p>So when I try and pass it like this I get an error <code>The action 'GO_BACK' was not handled by any navigator.</code> Is it possible to pass a function like this?</p>