title: ReactNative - Undefined is not an object (evaluating x)
body: <p>I'm reading through, following a tutorial online about ReactNative where it "includes" a file into the project; almost like a partial.</p>
  
  <p>I get this error;</p>
  
  <p><a href="https://i.stack.imgur.com/Wq96j.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Wq96j.png" alt="Picture of an error"></a></p>
  
  <p>My <code>index.ios.js</code> is</p>
  
  <pre><code>// Imports
  import React, { Component } from 'react';
  import {
    AppRegistry,
    StyleSheet,
    Text,
    View
  } from 'react-native';
  
  //var DayItem = require('./src/day-item');
  import {
    DayItem
  } from './src/day-item';
  
  
  // Component
  class Weekdays extends Component {
    render() {
      return (
        &lt;View&gt;
          &lt;Text style={styles.textStyles}&gt;
            Days of the Week
          &lt;/Text&gt;
          &lt;DayItem /&gt;
        &lt;/View&gt;
      );
    }
  }
  
  AppRegistry.registerComponent('Weekdays', () =&gt; Weekdays);
  </code></pre>
  
  <p>The <code>day-item</code> file is:</p>
  
  <pre><code>// Imports
  import React, { Component } from 'react';
  import {
    AppRegistry,
    StyleSheet,
    Text
  } from 'react'
  
  // Component
  class DayItem extends Component { 
      render() {
          return (
              &lt;Text&gt;
              Hello world
              &lt;/Text&gt;
          );
      } 
  }
  
  var { NativeModules } = require('react-native');
  module.exports = NativeModules.DayItem;
  </code></pre>
  
  <p>I've not done React Native before, but I'm not sure what its referring to when it claims undefined is not an object.</p>
  
  <p>The idea is to include this module into my main project and present the DayItem module in one line.</p>
  
  <p>I have noticed that sometimes I get errors with</p>
  
  <p><code>&lt;DayItem /&gt;</code></p>
  
  <p>If I put it outside the <code>&lt;View&gt;</code>, but inside its fine.</p>
  
  <p>Anyhow, I am unsure of how to get my Hello World Partial to work inside my main file.</p>
  
  <p>Any help on this would be helpful.</p>
  
  <p>Thanks for now</p>