title: React className with ternary operator add class 'null'
body: <p>I'm trying to conditionally apply a class to my component using an expression like this:</p>
  
  <pre><code>.map(function(list, index) {
      &lt;div className={"myClass " + (position === index ? 'active' : null)}&gt;
  }
  </code></pre>
  
  <p>But it keeps adding <code>null</code> as class, with an end result like this:</p>
  
  <pre><code>&lt;div class="myClass active"&gt;...
  &lt;div class="myClass null"&gt;...
  </code></pre>
  
  <p>This is a simple example, with only 2 class names, so I could just replace <code>null</code> with the default class name. But in a more complex layout, I would need to duplicate the same name over and over again.</p>
  
  <p>Is there a better approach to solve this problem?</p>