title: Use state variable as Style props value
body: <p>I have a state variable that holds the name of the theme (Light, Dark, etc).</p>
  
  <p>In my render function, I would like to use the appropriate style for my components based on the theme.
  If the <code>DarkTheme</code> is being used on the "mainHeader" class for example, the style of the View component would be something like this:</p>
  
  <pre><code>&lt;View style = {DarkTheme.mainHeader}&gt;
  &lt;/View&gt;
  </code></pre>
  
  <p>If the theme is LightTheme, then it should be:</p>
  
  <pre><code>&lt;View style = {LightTheme.mainHeader}&gt;
  &lt;/View&gt;
  </code></pre>
  
  <p>For efficiency's sake, I thought that if I put the name of the theme in a state variable, I could do something like this:</p>
  
  <pre><code>&lt;View style = {{this.state.theme + '.mainHeader'}}&gt;
  &lt;/View&gt;
  </code></pre>
  
  <p>Expecting the evaluation of the theme variable to return either <strong><em>LightTheme.mainHeader</em></strong> or <strong><em>DarkTheme.mainHeader.</em></strong></p>
  
  <p>But I am wrong, this does not work.
  Is there anyway I can make this work?</p>