title: React Native - Invariant Violation
body: <p>So ive built a Spinner component and i keep getting Invariant Violation.</p>
  
  <p>Component: </p>
  
  <pre><code>import React from 'react';
  import { View, ActivityIndicator } from 'react-native';
  
  const Spinner = ({ size }) =&gt; {
      return ( 
          &lt;View style={ styles.spinnerStyle }&gt;
              &lt;ActivityIndicator size={ size || 'large' } /&gt;
          &lt;/View&gt;
      );
  };
  
  const styles = {
      spinnerStyle: {
          flex: 1,
          justifyContent: 'center',
          alignItems: 'center'
      }
  };
  
  export { Spinner };
  </code></pre>
  
  <p>And Im using it here: </p>
  
  <pre><code>// Import libs
  import React, { Component } from 'react';
  import { ScrollView } from 'react-native';
  import Axios from 'axios';
  import AlbumDetail from './albumDetail';
  import { Spinner } from './common';
  
  // Create component
  class AlbumList extends Component {
      state = {
          albums: [],
          loading: true
      }
  
      componentWillMount() {
          Axios.get('xxxxx.json').then(response =&gt;
              this.setState({
                  albums: response.data,
                  loading: false
              })
          );
      }
  
      renderAlbums() {
          if ( this.state.loading ) {
              return &lt;Spinner size='small'&gt;&lt;/Spinner&gt;
          }
  
          return this.state.albums.map( album =&gt; 
              &lt;AlbumDetail key={album.title} album={album}/&gt;
          )
      }
  
      render() {
          return (
              &lt;ScrollView&gt;
                  {this.renderAlbums()}
              &lt;/ScrollView&gt;
          );
      }
  }
  
  // Export the component for the rest to use
  export default AlbumList;
  </code></pre>
  
  <p>The full error is: Invariant Violation:Element type is invalid: expected a string.</p>
  
  <p>I tried just adding:</p>
  
  <pre><code>if ( this.state.loading ) {
     return (
         &lt;View style={styles.loading}&gt;
            &lt;ActivityIndicator size='large' /&gt;
          &lt;/View&gt;
      )
   }
  </code></pre>
  
  <p>And that works. But when used as a component it doesn't want to play. Any help would be great. Thanks</p>