title: React Navigation route.params typescript
body: <p>I'm creating a Expo managed React Native app with TypeScript and having some problems with React Navigation and TypeScript.</p>
  <p>I want to specify the icon for the Bottom Tab Navigator on the Tab.Screen component.</p>
  <p>This code works but complains because route.params could be undefined (line 10).</p>
  <p><em>Property 'icon' does not exist on type 'object'</em></p>
  <p>Can I make the icon prop required on initialParams?</p>
  <p>I have looked in the documentation without any luck.</p>
  <pre><code>const App: React.FC&lt;{}&gt; = () =&gt; {
    return (
      &lt;SafeAreaView style={styles.container}&gt;
        &lt;NavigationContainer&gt;
          &lt;Tab.Navigator
            screenOptions={({ route }) =&gt; ({
              tabBarIcon: ({ size, color }) =&gt; (
                &lt;MaterialIcons
                  size={size}
  /* ===&gt; */      name={route.params.icon}
                  color={color}
                /&gt;
              ),
            })}
          &gt;
            &lt;Tab.Screen
              name=&quot;EventListView&quot;
              initialParams={{ icon: 'view-agenda' }}
              component={EventListScreen}
            /&gt;
            &lt;Tab.Screen
              name=&quot;CreateEvent&quot;
              initialParams={{ icon: 'public' }}
              component={SettingsScreen}
            /&gt;
          &lt;/Tab.Navigator&gt;
        &lt;/NavigationContainer&gt;
      &lt;/SafeAreaView&gt;
    )
  }
  </code></pre>