title: Getting "Undefined is not an object (evaluating StyleSheet.create)" error in React Native
body: <p>I'm new to react-native and i'm trying to use swipe navigation in an app I'm creating. I've installed randomcolor, as well as native-react-swipe but for some reason I'm still getting an error.</p>
  
  <pre><code>import React, {Component} from 'react';
  import Swiper from 'react-native-swiper'
  import randomcolor from 'randomcolor'
  
  const {
    View,
    Text,
    StyleSheet
  } = React
  
  const styles = StyleSheet.create({
    container: {
      flex: 1
    },
    view: {
      flex: 1,
      justifyContent: 'center',
      alignItems: 'center',
    }
  });
  
  class TitleText extends React.Component {
    render() {
      return (
        &lt;Text style={{ fontSize: 48, color: 'white' }}&gt;
          {this.props.label}
        &lt;/Text&gt;
      )
    }
  }
  
  class Home extends React.Component {
  
    viewStyle() {
      return {
        flex: 1,
        backgroundColor: randomcolor(),
        justifyContent: 'center',
        alignItems: 'center',
      }
    }
  
    render() {
      return (
        &lt;Swiper
          loop={false}
          showsPagination={false}
          index={1}&gt;
          &lt;View style={this.viewStyle()}&gt;
            &lt;TitleText label="Left" /&gt;
          &lt;/View&gt;
          &lt;Swiper
            horizontal={false}
            loop={false}
            showsPagination={false}
            index={1}&gt;
            &lt;View style={this.viewStyle()}&gt;
              &lt;TitleText label="Top" /&gt;
            &lt;/View&gt;
            &lt;View style={this.viewStyle()}&gt;
              &lt;TitleText label="Home" /&gt;
            &lt;/View&gt;
            &lt;View style={this.viewStyle()}&gt;
              &lt;TitleText label="Bottom" /&gt;
            &lt;/View&gt;
          &lt;/Swiper&gt;        
          &lt;View style={this.viewStyle()}&gt;
            &lt;TitleText label="Right" /&gt;
          &lt;/View&gt;
        &lt;/Swiper&gt;
  
      )
    }
  }
  
  export default Home
  </code></pre>
  
  <p>The error I'm getting says "undefined is not an object (evaluating 'StyleSheet.create')". I've been trying to crack it for a while now, but haven't had any luck..
  That's the code that I have, any help would be greatly appreciated!</p>