title: Cannot read property of undefined in React Native style
body: <p>I'm trying to access my <code>styles</code> property as usual, however, I'm getting an error: <code>Cannot read property 'swipeButtonCommon' of undefined</code>.</p>
  
  <p>Well, my <code>styles</code> object is defined as has <code>swipeButtonCommon</code> anyway:</p>
  
  <pre><code>const styles = StyleSheet.create({
      ...
      swipeButtonCommon:{
          backgroundColor: Color.listActionBackground
      },
     ...
     //swipeButtonLeft and swipeButtonRight are also defined
  })
  
  function SwipeButton(title:string, side: 'left' | 'center' | 'right'){
      let styleClass: string | null = null;
  
      if(side == 'left'){
          styleClass = 'swipeButtonLeft';
      }else if(side == 'right'){
          styleClass = 'swipeButtonRight'
      }
      return (
          &lt;View style={[styles.swipeButtonCommon, styles[styleClass!]]}&gt;&lt;Text&gt;{title}&lt;/Text&gt;&lt;/View&gt;
      )
  }
  </code></pre>
  
  <p>I'm getting the error in <code>&lt;View style={...}</code> line, and even though I have a breakpoint set, it's not hitting for some reason. I've cleared the Metro Bundler cache and Haste module map, and I've restarted pretty much everything, though no avail. What am I doing wrong?</p>