title: Typescript: Property "navigation" does not exist on type Omit react navigation v5
body: <p>i am trying to refactor my code in react native from javascript to typescript with this tutorial: <a href="https://reactnavigation.org/docs/5.x/typescript/#nesting-navigators" rel="nofollow noreferrer">https://reactnavigation.org/docs/5.x/typescript/#nesting-navigators</a>
  By doing types for react navigation v5 i got an error:</p>
  <blockquote>
  <p>Property 'navigation' does not exist on type 'Omit&lt;{ dispatch(action:
  Readonly&lt;{ type: string; payload?: object; source?: string; target?:
  string; }&gt; | ((state: TabNavigationState) =&gt;
  Readonly&lt;...&gt;)): void; ... 8 more ...; dangerouslyGetState():
  TabNavigationState&lt;...&gt;; } &amp; ... 10 more ... &amp;
  StackActionHelpers&lt;...&gt;, &quot;dispatch&quot; | ... 11 more ...'.</p>
  </blockquote>
  <p>My navigation structure:
  <a href="https://i.stack.imgur.com/Li1pN.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Li1pN.png" alt="navigation structure" /></a></p>
  <p>Expected results:</p>
  <p>I want that i can access routes and params by Favorites Screen and can navigate to nested screen from there like this: (navigate(&quot;Root&quot;,{screen:&quot;Something&quot;})</p>
  <p>Code works with javascript but by typescript there are errors with types.</p>
  <p>My code:</p>
  <p>types.ts</p>
  <pre><code>export type FavoriteProps = CompositeNavigationProp&lt;
    MaterialTopTabNavigationProp&lt;FavoritesParamList&gt;,
    NativeStackNavigationProp&lt;RootStackParamList&gt;
  &gt;;
  </code></pre>
  <p>FavoriteScreen.tsx</p>
  <pre><code>const FavoriteScreen = ({ route, navigation }: FavoriteProps) =&gt; {
    const favoriteMovies = useAppSelector((state) =&gt; state.users.favoriteMovies);
    const favoriteSeries = useAppSelector((state) =&gt; state.users.favoriteSeries);
  
    const changeRouteName = () =&gt; {
      if (route.name === &quot;favMovies&quot;) {
        return true;
      } else {
        return false;
      }
    };
    const [movieTab, setMovieTab] = useState(changeRouteName);
  </code></pre>
  <p>AppNavigator.tsx</p>
  <pre><code>export type RootStackParamList = {
    Home: undefined;
    ShowAll: { id: number; name: string };
  ...
  };
  
  const Stack = createNativeStackNavigator&lt;RootStackParamList&gt;();
  function AppNavigator() {
          &lt;Stack.Navigator&gt;
            &lt;Stack.Screen name=&quot;Home&quot; component={TabScreens} options={{ headerShown: false }} /&gt;
      &lt;/Stack.Navigator&gt;
  
  export const TabScreens = ({ navigation }) =&gt; {
        &lt;Tab.Screen name=&quot;Favorites&quot; component={FavStackScreen} options={{ tabBarLabel: strings.favorites }} /&gt;
  }
  ...
  </code></pre>
  <p>BottomTabNavigator.tsx</p>
  <pre><code>export type BottomTabParamList = {
  ...
    Favorites: NavigatorScreenParams&lt;FavoritesParamList&gt;;
    User: UserParamList;
  };
  
  
  export type FavoritesParamList = { favMovies: undefined; favSeries: undefined };
  
  const Tab = createBottomTabNavigator&lt;BottomTabParamList&gt;();
  
  const FavTab = createMaterialTopTabNavigator&lt;FavoritesParamList&gt;();
  function FavStackScreen() {
    return (
      &lt;FavTab.Navigator
        tabBarOptions={{
          indicatorStyle: { backgroundColor: &quot;tomato&quot; },
          labelStyle: { fontSize: 14, fontFamily: &quot;Montserrat-Bold&quot; },
        }}
      &gt;
        &lt;FavTab.Screen name=&quot;favMovies&quot; component={FavoriteScreen} options={{ tabBarLabel: strings.movies }} /&gt;
        &lt;FavTab.Screen name=&quot;favSeries&quot; component={FavoriteScreen} options={{ tabBarLabel: strings.series }} /&gt;
      &lt;/FavTab.Navigator&gt;
    );
  }
  </code></pre>
  <p>Fixed by changing types to:</p>
  <pre><code>type FavoriteRouteProp = RouteProp&lt;FavoritesParamList, &quot;favMovies&quot;&gt;;
  
  type FavoriteNavigationProp = CompositeNavigationProp&lt;
    MaterialTopTabNavigationProp&lt;FavoritesParamList&gt;,
    NativeStackNavigationProp&lt;RootStackParamList&gt;
  &gt;;
  
  export type FavoriteProps = {
    navigation: FavoriteNavigationProp;
    route: FavoriteRouteProp;
  };
  </code></pre>