title: module export - Getting property 'default' of undefined in React Native
body: <p>Facing problem with <strong>importing and exporting files</strong>. This was working with <strong>react-native 0.51.0</strong> </p>
  
  <p>But not in <strong>react-native: 0.56</strong> </p>
  
  <pre><code>"babel-eslint": "7.2.3",
  "babel-plugin-transform-remove-console": "6.9.0",
  "babel-preset-react-native": "^5",
  </code></pre>
  
  <p>Is it a problem with module.exports and export default or with babel version?</p>
  
  <p>Getting error saying that</p>
  
  <blockquote>
    <p>Cannot read property 'default' of undefined<br>
    Object.get [as API]</p>
  </blockquote>
  
  <p><strong>repolib/index.js</strong></p>
  
  <pre><code>import * as components from './components';
  import * as utils from './utils';
  
  var Utils = {
    Logger: utils.Logger,
    Toast: utils.Toast
  }
  
  var Components = {
    Button: components.Button
  }
  
  module.exports = {
    Utils,
    Components,
  }
  </code></pre>
  
  <p><strong>Utils/Toast.js</strong></p>
  
  <pre><code>var Toast = require('../repolib').Utils.Toast;
  export default {
    ...(Toast)
  }
  </code></pre>
  
  <p><strong>API/loginAPI.js</strong></p>
  
  <pre><code>import Toast from '../Utils/Toast';
  export default {
    login: () =&gt; {...}
  }
  </code></pre>
  
  <p><strong>API/index.js</strong></p>
  
  <pre><code>import loginAPI from './loginAPI';
  export default {
    loginAPI
  }
  </code></pre>
  
  <p><strong>common/index.js</strong></p>
  
  <pre><code>export { default as API } from '../API';
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/72QPT.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/72QPT.png" alt="enter image description here"></a></p>