title: How to use ref in (conditional render)
body: <p>I want to use ref, however I am not able to use this in the conditional rendering which is initially false.</p>
  
  <pre><code>constructor(props) {
      super(props);
      this.state = { 
        filterActive: false,
      }
      this.firstRef = React.createRef();
  
  }
  </code></pre>
  
  <p>If I use ref in this :-</p>
  
  <pre><code>{this.state.filterActive ?
      &lt;label ref={this.firstRef}&gt;Time Range&lt;/label&gt;
  :null}
  </code></pre>
  
  <p>The ref is null.</p>