title: React navigation 5 error Binding element 'navigation' implicitly has an 'any' type.ts
body: <p>I am new to react-native. I am trying to implement navigation using react-navigation 5. I have two screens Home and profile. These both components have received a navigation prop but typescript is giving me follwoing error</p>
  <pre><code>Binding element 'navigation' implicitly has an 'any' type.ts(7031)
  </code></pre>
  <p>How to get rid of this error.</p>
  <p>Thank you in advance</p>
  <p>NOTE - I am using typescript</p>
  <p>App.tsx</p>
  <pre><code>import 'react-native-gesture-handler';
  
  import { NavigationContainer } from '@react-navigation/native';
  import { createStackNavigator } from '@react-navigation/stack';
  
  const Stack = createStackNavigator();
  
  import Home from './screens/home'
  
  const App  = () =&gt; {
  
    const ProfileScreen = ({}) =&gt; {
      return &lt;Text&gt;This is Jane's profile&lt;/Text&gt;;
    };
    
    return (
      &lt;NavigationContainer&gt;
  
      &lt;Stack.Navigator&gt;
          &lt;Stack.Screen
            name=&quot;Home&quot;
            component={Home}
            
          /&gt;
          &lt;Stack.Screen name=&quot;Profile&quot; component={ProfileScreen} /&gt;
        &lt;/Stack.Navigator&gt;
  
    &lt;/NavigationContainer&gt;
  
    );
  };
  </code></pre>
  <p>Home.tsx</p>
  <pre><code>import React from 'react';
  import { Button } from 'react-native';
  
  
  const Home = ({navigation}) =&gt;{ // error
  
    return (
      &lt;Button
      title=&quot;Go to Jane's profile&quot;
      onPress={() =&gt;
        navigation.navigate('Profile', { name: 'Jane' })
      }
    /&gt;
    )
    
  }
  
  export default Home;
  </code></pre>