title: ReferenceError: Can't find variable: React -- bundle android
body: <p>Hi  i am having problems when i try to put createStackNavigator, but if i remove it, it is ok.</p>
  <p>My code is</p>
  <pre><code>import Home from '../home/home.component';
  import {createAppContainer} from 'react-navigation';
  import {createStackNavigator} from 'react-navigation-stack';
  import React from 'react';
  
  const NavStack = createStackNavigator(
    {
      ScreenLogin: {
        screen: Home,
        navigationOptions: {
          header: null,
        },
      },
    },
    {
      defaultNavigationOptions: {
        //header: null,
      },
    },
  );
  
  const AppNavigator = createAppContainer(NavStack);
  
  export default AppNavigator;
  </code></pre>
  <p>The home</p>
  <pre><code>import React from 'react';
  import {Text, View} from 'react-native';
  
  const Home = () =&gt; {
    return (
      &lt;View
        style={{
          flex: 1,
          justifyContent: 'center',
          alignItems: 'center',
        }}&gt;
        &lt;Text&gt;Hello, world!&lt;/Text&gt;
      &lt;/View&gt;
    );
  };
  export default Home;
  </code></pre>
  <p>The stack</p>
  <p>E/ReactNativeJS: ReferenceError: Can't find variable: React</p>
  <pre><code>This error is located at:
      in h
      in RCTView
      in Unknown
      in RCTView
      in Unknown
      in C
  </code></pre>
  <p>E/unknown:ReactNative: ReferenceError: Can't find variable: React</p>
  <pre><code>This error is located at:
      in h
      in RCTView
      in Unknown
      in RCTView
      in Unknown
      in C, stack:
  value@392:868
  al@77:54989
  ja@77:79095
  Ba@77:78997
  Qa@77:78762
  Ia@77:75924
  Ia@-1
  &lt;unknown&gt;@77:26326
  unstable_runWithPriority@142:3806
  ht@77:26273
  pt@77:26208
  Pa@77:73297
  pi@77:88605
  render@77:95350
  exports@339:626
  run@336:694
  runApplication@336:1753
  value@41:3469
  &lt;unknown&gt;@41:662
  value@41:2459
  value@41:634
  value@-1
  </code></pre>
  <p>E/ReactNativeJS: ReferenceError: Can't find variable: React</p>
  <pre><code>This error is located at:
      in h
      in RCTView
      in Unknown
      in RCTView
      in Unknown
      in C
  </code></pre>
  <p>FATAL EXCEPTION: mqt_native_modules
  Process: com.co.prueba, PID: 21016
  com.facebook.react.common.JavascriptException: ReferenceError: Can't find variable: React</p>
  <pre><code>This error is located at:
      in h
      in RCTView
      in Unknown
      in RCTView
      in Unknown
      in C, stack:
  value@392:868
  al@77:54989
  ja@77:79095
  Ba@77:78997
  Qa@77:78762
  Ia@77:75924
  Ia@-1
  &lt;unknown&gt;@77:26326
  unstable_runWithPriority@142:3806
  ht@77:26273
  pt@77:26208
  Pa@77:73297
  pi@77:88605
  render@77:95350
  exports@339:626
  run@336:694
  runApplication@336:1753
  value@41:3469
  &lt;unknown&gt;@41:662
  value@41:2459
  value@41:634
  value@-1
  
      at com.facebook.react.modules.core.ExceptionsManagerModule.reportException(ExceptionsManagerModule.java:83)
      at java.lang.reflect.Method.invoke(Native Method)
      at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:372)
      at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:151)
      at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)
      at android.os.Handler.handleCallback(Handler.java:938)
      at android.os.Handler.dispatchMessage(Handler.java:99)
      at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:27)
      at android.os.Looper.loop(Looper.java:223)
      at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:226)
      at java.lang.Thread.run(Thread.java:923)
  </code></pre>
  <p>The package json</p>
  <pre><code>{
    &quot;name&quot;: &quot;Test&quot;,
    &quot;version&quot;: &quot;0.0.1&quot;,
    &quot;private&quot;: true,
    &quot;scripts&quot;: {
      &quot;android&quot;: &quot;react-native run-android --port=8089&quot;,
      &quot;ios&quot;: &quot;react-native run-ios&quot;,
      &quot;start&quot;: &quot;react-native start --port=8089&quot;
    },
    &quot;dependencies&quot;: {
      &quot;prop-types&quot;: &quot;^15.7.2&quot;,
      &quot;react&quot;: &quot;17.0.1&quot;,
      &quot;react-native&quot;: &quot;0.64.2&quot;,
      &quot;react-native-dotenv&quot;: &quot;^2.5.5&quot;,
      &quot;react-native-fetch-polyfill&quot;: &quot;^1.1.3&quot;,
      &quot;react-native-fs&quot;: &quot;^2.18.0&quot;,
      &quot;react-native-gesture-handler&quot;: &quot;^1.10.3&quot;,
      &quot;react-native-indicators&quot;: &quot;^0.17.0&quot;,
      &quot;react-native-keyboard-aware-scroll-view&quot;: &quot;^0.9.4&quot;,
      &quot;react-native-linear-gradient&quot;: &quot;^2.5.6&quot;,
      &quot;react-native-reanimated&quot;: &quot;^2.2.0&quot;,
      &quot;react-native-safe-area-context&quot;: &quot;^3.2.0&quot;,
      &quot;react-native-screens&quot;: &quot;^3.4.0&quot;,
      &quot;react-navigation&quot;: &quot;^4.4.4&quot;,
      &quot;react-navigation-stack&quot;: &quot;^2.10.4&quot;
    },
    &quot;devDependencies&quot;: {
      &quot;@babel/core&quot;: &quot;7.14.6&quot;,
      &quot;@babel/runtime&quot;: &quot;7.14.6&quot;,
      &quot;@react-native-community/eslint-config&quot;: &quot;2.0.0&quot;,
      &quot;babel-jest&quot;: &quot;26.6.3&quot;,
      &quot;eslint&quot;: &quot;7.14.0&quot;,
      &quot;jest&quot;: &quot;26.6.3&quot;,
      &quot;metro-react-native-babel-preset&quot;: &quot;0.64.0&quot;,
      &quot;react-test-renderer&quot;: &quot;17.0.1&quot;
    },
    &quot;jest&quot;: {
      &quot;preset&quot;: &quot;react-native&quot;
    }
  }
  </code></pre>
  <p>Then if i only leave the home component, it is ok in the native application, but the createStackNavigator causes  the crash.</p>
  <p>I am moving the React import to the top of the file, now i ma having the next error if i start with react navigation</p>
  <pre><code>import React from 'react';
  import AppNavigator from './components/navigator/navigator.component';
  
  export default class AppTest extends React.Component {
    constructor(props) {
      super(props);
    }
  
    componentDidMount() {}
  
    render() {
      return &lt;AppNavigator /&gt;;
    }
  }
  </code></pre>
  <p>The error</p>
  <p>E/ReactNativeJS: Invariant Violation: requireNativeComponent: &quot;RNSScreen&quot; was not found in the UIManager.</p>
  <pre><code>This error is located at:
      in E
      in R
      in RCTView
      in Unknown
      in RCTView
      in Unknown
      in C
  </code></pre>
  <p>E/unknown:ReactNative: Invariant Violation: requireNativeComponent: &quot;RNSScreen&quot; was not found in the UIManager.</p>
  <pre><code>This error is located at:
      in E
      in R
      in RCTView
      in Unknown
      in RCTView
      in Unknown
      in C, stack:
  exports@26:286
  exports@161:1002
  get@74:883
  wl@77:59730
  Oa@77:79273
  ja@77:79156
  Ba@77:78997
  Qa@77:78762
  Ia@77:75924
  Ia@-1
  &lt;unknown&gt;@77:26326
  unstable_runWithPriority@142:3806
  ht@77:26273
  pt@77:26208
  Pa@77:73297
  pi@77:88605
  render@77:95350
  exports@339:626
  run@336:694
  runApplication@336:1753
  value@41:3469
  &lt;unknown&gt;@41:662
  value@41:2459
  value@41:634
  value@-1
  </code></pre>
  <p>E/ReactNativeJS: Invariant Violation: requireNativeComponent: &quot;RNSScreen&quot; was not found in the UIManager.</p>
  <pre><code>This error is located at:
      in E
      in R
      in RCTView
      in Unknown
      in RCTView
      in Unknown
      in C
  
  --------- beginning of crash
  </code></pre>
  <p>E/AndroidRuntime: FATAL EXCEPTION: mqt_native_modules
  Process: com.co.test, PID: 24369
  com.facebook.react.common.JavascriptException: Invariant Violation: requireNativeComponent: &quot;RNSScreen&quot; was not found in the UIManager.</p>
  <pre><code>This error is located at:
      in E
      in R
      in RCTView
      in Unknown
      in RCTView
      in Unknown
      in C, stack:
  exports@26:286
  exports@161:1002
  get@74:883
  wl@77:59730
  Oa@77:79273
  ja@77:79156
  Ba@77:78997
  Qa@77:78762
  Ia@77:75924
  Ia@-1
  &lt;unknown&gt;@77:26326
  unstable_runWithPriority@142:3806
  ht@77:26273
  pt@77:26208
  Pa@77:73297
  pi@77:88605
  render@77:95350
  exports@339:626
  run@336:694
  runApplication@336:1753
  value@41:3469
  &lt;unknown&gt;@41:662
  value@41:2459
  value@41:634
  value@-1
  
      at com.facebook.react.modules.core.ExceptionsManagerModule.reportException(ExceptionsManagerModule.java:83)
      at java.lang.reflect.Method.invoke(Native Method)
      at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:372)
      at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:151)
      at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)
      at android.os.Handler.handleCallback(Handler.java:938)
      at android.os.Handler.dispatchMessage(Handler.java:99)
      at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:27)
      at android.os.Looper.loop(Looper.java:223)
      at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:226)
      at java.lang.Thread.run(Thread.java:923)
  </code></pre>