title: How can I know my current route in react-navigation 5?
body: <p>I am using this <a href="https://reactnavigation.org/docs/en/navigating-without-navigation-prop.html" rel="noreferrer">https://reactnavigation.org/docs/en/navigating-without-navigation-prop.html</a> to access my navigation from any source, my file look as follow:</p>
  
  <pre><code>import { createRef } from 'react';
  
  export const navigationRef = createRef();
  
  export function navigate(name, params) {
    return navigationRef.current?.navigate(name, params);
  }
  
  export function goBack() {
    return navigationRef.current?.goBack();
  }
  
  export function getRootState() {
    return navigationRef.current?.getRootState();
  }
  </code></pre>
  
  <p>This is perfect for my <code>@navigation/drawer</code>, which is outside my stack navigation. </p>
  
  <p>Only one problem the last method is not synchronized and I want to have an active state on my item menu that is the current route.</p>
  
  <p>How is that possible with react navigation 5?</p>