title: react-native error in NavigationContainer
body: <p>As I'm new to <code>react-native</code>, I'm just trying to build a simple app in <code>react-native</code> that can navigate.</p>
  
  <p><em>index.js</em></p>
  
  <pre><code>import React from 'react';
  import {AppRegistry} from 'react-native';
  import App from './App';
  import {name as appName} from './app.json';
  import 'react-native-gesture-handler';
  import {NavigationContainer} from '@react-navigation/native';
  import Login from './Login';
  import createStackNavigator from '@react-navigation/stack/src/navigators/createStackNavigator';
  
  const Stack = createStackNavigator();
  
  function MyStack() {
    return (
      &lt;NavigationContainer&gt;
        &lt;Stack.Navigator&gt;
          &lt;Stack.Screen
            name="Home"
            component={App}
            options={{title: 'Welcome'}}
          /&gt;
          &lt;Stack.Screen name="Profile" component={Login} /&gt;
        &lt;/Stack.Navigator&gt;
      &lt;/NavigationContainer&gt;
    );
  }
  
  AppRegistry.registerComponent(appName, MyStack);
  </code></pre>
  
  <p>Now it is giving me error : </p>
  
  <p><a href="https://i.stack.imgur.com/QZxGn.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/QZxGn.png" alt="enter image description here"></a></p>
  
  <p>If I wrap that <code>MyStack</code> it gives me another error :</p>
  
  <p><a href="https://i.stack.imgur.com/lpX5h.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/lpX5h.png" alt="enter image description here"></a></p>
  
  <p>My <em>package.json</em>:</p>
  
  <pre><code>
    "dependencies": {
      "@freakycoder/react-native-helpers": "^0.1.2",
      "@react-native-community/masked-view": "^0.1.6",
      "@react-navigation/native": "^5.0.6",
      "@react-navigation/stack": "^5.0.6",
      "react": "16.9.0",
      "react-native": "0.61.5",
      "react-native-dynamic-vector-icons": "^0.2.1",
      "react-native-gesture-handler": "^1.6.0",
      "react-native-improved-text-input": "^0.0.1",
      "react-native-login-screen": "^0.3.6",
      "react-native-safe-area-context": "^0.7.3",
      "react-native-screens": "^2.0.0-beta.8",
      "react-native-spinkit": "^1.5.0",
      "react-native-splash-screen": "^3.2.0",
      "react-native-vector-icons": "^6.6.0"
    },
    "devDependencies": {
      "@babel/core": "^7.8.4",
      "@babel/runtime": "^7.8.4",
      "@react-native-community/eslint-config": "^0.0.7",
      "babel-jest": "^25.1.0",
      "eslint": "^6.8.0",
      "jest": "^25.1.0",
      "metro-react-native-babel-preset": "^0.58.0",
      "react-test-renderer": "16.9.0"
    },
  </code></pre>
  
  <p>In my <code>app/build.gradle</code> I have added these two :</p>
  
  <pre><code>implementation 'androidx.appcompat:appcompat:1.1.0-rc01'
  implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0-alpha02'
  </code></pre>
  
  <p>Re-started and invalidated cache too.</p>