title: Type Error when trying Stack Navigator from React Navigation
body: <p>I'm running the example below locally but get a TypeError.</p>
  
  <pre><code>import HomeScreen from './screens/HomeScreen';
  import SecoundScreen from './screens/SecoundScreen';
  import ThirdScreen from './screens/ThirdScreen';
  import { NavigationContainer } from '@react-navigation/native';
  import { createStackNavigator } from '@react-navigation/stack';
  
  const Stack = createStackNavigator();
  
  function MyStack() {
      return (
        &lt;Stack.Navigator&gt;
              &lt;Stack.Screen name="Home" component={HomeScreen} /&gt;
              &lt;Stack.Screen name="Second" component={SecoundScreen} /&gt;
              &lt;Stack.Screen name="Third" component={ThirdScreen} /&gt;
        &lt;/Stack.Navigator&gt;
      );
  }
  
  export default function App() {
      return (
        &lt;NavigationContainer&gt;
          &lt;MyStack /&gt;
        &lt;/NavigationContainer&gt;
      );
  }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/AyAmx.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/AyAmx.png" alt="Type Error"></a></p>
  
  <p>I copied the from the example, and it didn't work before I modified it either @ <a href="https://reactnavigation.org/docs/en/stack-navigator.html" rel="nofollow noreferrer">https://reactnavigation.org/docs/en/stack-navigator.html</a> </p>
  
  <p><a href="https://snack.expo.io/?platform=android&amp;name=createStackNavigator%20%C2%B7%20React%20Navigation&amp;dependencies=%40react-native-community%2Fmasked-view%40%5E0.1.1%2C%40react-navigation%2Fnative%40%5E5.0.0%2C%40react-navigation%2Fbottom-tabs%40%5E5.0.0%2C%40react-navigation%2Fdrawer%40%5E5.0.0%2C%40react-navigation%2Fmaterial-bottom-tabs%40%5E5.0.0%2C%40react-navigation%2Fmaterial-top-tabs%40%5E5.0.0%2C%40react-navigation%2Fnative-stack%40%5E5.0.0%2C%40react-navigation%2Fstack%40%5E5.0.0%2Creact-native-gesture-handler%401.5.2%2Creact-native-reanimated%401.4.0%2Creact-native-safe-area-context%400.6.0%2Creact-native-screens%402.0.0-alpha.12&amp;sourceUrl=https%3A%2F%2Freactnavigation.org%2Fexamples%2F5.x%2Fsimple-stack.js" rel="nofollow noreferrer">https://snack.expo.io/?platform=android&amp;name=createStackNavigator%20%C2%B7%20React%20Navigation&amp;dependencies=%40react-native-community%2Fmasked-view%40%5E0.1.1%2C%40react-navigation%2Fnative%40%5E5.0.0%2C%40react-navigation%2Fbottom-tabs%40%5E5.0.0%2C%40react-navigation%2Fdrawer%40%5E5.0.0%2C%40react-navigation%2Fmaterial-bottom-tabs%40%5E5.0.0%2C%40react-navigation%2Fmaterial-top-tabs%40%5E5.0.0%2C%40react-navigation%2Fnative-stack%40%5E5.0.0%2C%40react-navigation%2Fstack%40%5E5.0.0%2Creact-native-gesture-handler%401.5.2%2Creact-native-reanimated%401.4.0%2Creact-native-safe-area-context%400.6.0%2Creact-native-screens%402.0.0-alpha.12&amp;sourceUrl=https%3A%2F%2Freactnavigation.org%2Fexamples%2F5.x%2Fsimple-stack.js</a></p>
  
  <p>The code below is working! I just installed react-navigation, so I should have the latest version!</p>
  
  <pre><code>import React, { useState } from 'react';
  import { Button, View } from 'react-native';
  
  import HomeScreen from './screens/HomeScreen';
  import SecondScreen from './screens/SecondScreen';
  import ThirdScreen from './screens/ThirdScreen';
  
  
  import { createAppContainer } from 'react-navigation';
  import { createStackNavigator } from 'react-navigation-stack';
  
  const AppNavigator = createStackNavigator(
      {
          Home: HomeScreen,
          Second: SecondScreen,
          Third: ThirdScreen
      },
      {
          initialRouteName: 'Home',
      }
  );
  export default createAppContainer(AppNavigator);
  </code></pre>
  
  <p>Any idea why the first version is failing? </p>
  
  <p>package.json before and after npm update:</p>
  
  <pre><code>  {
    "main": "node_modules/expo/AppEntry.js",
    "scripts": {
      "start": "expo start",
      "android": "expo start --android",
      "ios": "expo start --ios",
      "web": "expo start --web",
      "eject": "expo eject"
    },
    "dependencies": {
      "@react-native-community/masked-view": "0.1.5",
      "@react-navigation/stack": "^5.0.0",
      "expo": "~36.0.0",
      "react": "~16.9.0",
      "react-dom": "~16.9.0",
      "react-native": "https://github.com/expo/react-native/archive/sdk-36.0.0.tar.gz",
      "react-native-gesture-handler": "~1.5.0",
      "react-native-paper": "^3.6.0",
      "react-native-reanimated": "~1.4.0",
      "react-native-safe-area-context": "0.6.0",
      "react-native-screens": "2.0.0-alpha.12",
      "react-native-web": "~0.11.7",
      "react-navigation": "^4.1.1",
      "react-navigation-fluid-transitions": "^0.3.2",
      "react-navigation-stack": "^2.1.1"
    },
    "devDependencies": {
      "babel-preset-expo": "~8.0.0",
      "@babel/core": "^7.0.0"
    },
    "private": true
  }
  </code></pre>