title: Compare the performance between hiding React components with css and state management
body: <p>If I have a React component and I want to hide it. At the moment, I am taking two approaches:</p>
  
  <p>The state management way</p>
  
  <pre><code>render() {
      return (
          &lt;div&gt;
              { this.state.showComponent &amp;&amp; &lt;Component/&gt; }
          &lt;/div&gt;
      );
  }
  </code></pre>
  
  <p>The CSS way:</p>
  
  <pre><code>render() {
      return (
          &lt;div&gt;
              &lt;Component className="hide-with-CSS"/&gt;
          &lt;/div&gt;
      );
  }    
  </code></pre>
  
  <p>I assume that the former way will remove/add the component based on the current state while the latter way just "hides" it. So my questions are:</p>
  
  <ul>
  <li>Which method would produce a better performance?</li>
  <li>Is there another way to efficiently hide an element?</li>
  </ul>