title: How to use index.js instead of (index.ios.js, index.android.js) in React Native for cross-platform app?
body: <p>Thanks for the answers from now,</p>
  
  <p>I am a newbie in <strong>React Native</strong>, I want to make a cross-platform app so I created index.js:</p>
  
  <pre><code>import React from 'react';
  import {
      Component,
      View,
      Text,
  } from 'react-native';
  
  class ReactApp extends Component {
  
      render() {
          return (
              &lt;View&gt;&lt;Text&gt;Hello world&lt;/Text&gt;&lt;/View&gt;
          );
      }
  }
  
  module.exports = ReactApp;
  </code></pre>
  
  <p>Then I imported index.js from both index.ios.js and index.android.js like this:</p>
  
  <pre><code>import { AppRegistry } from 'react-native';
  import ReactApp from './index';
  
  AppRegistry.registerComponent('ReactApp', () =&gt; ReactApp);
  </code></pre>
  
  <p>I think after this it should work but I get this 
  error:</p>
  
  <p><a href="https://i.stack.imgur.com/LoZZR.png" rel="noreferrer"><img src="https://i.stack.imgur.com/LoZZR.png" alt="enter image description here"></a></p>