How to auto open react DatePicker
<p>I have the following code</p>

<pre><code>      case 'date':
    if (Modernizr.touchevents &amp;&amp; Modernizr.inputtypes &amp;&amp; Modernizr.inputtypes.date) {
      element = (
        &lt;input
          type='date'
          id={this.props.id}
          name={this.props.name}
          onChange={arg =&gt; this.changeValue(moment(arg &amp;&amp; arg.currentTarget ? arg.currentTarget.value : arg))}
          onBlur={arg =&gt; this.blurValue(moment(arg &amp;&amp; arg.currentTarget ? arg.currentTarget.value : arg))}
          value={this.getValue() ? moment(this.getValue()).format('YYYY-MM-DD') : moment(this.props.minDate).format('YYYY-MM-DD')}
          tabIndex={this.props.tabIndex}
          min={this.props.minDate || null}
          max={this.props.maxDate || null}
        /&gt;
      );
    } else {
      element = (
        &lt;DatePicker
          {...this.props}
          name={this.props.name}
          onChange={this.changeValue}
          selected={this.getValue() || this.props.selected}
          startDate={this.props.startDate || null}
          endDate={this.props.endDate || null}
          minDate={this.props.minDate || null}
          tabIndex={this.props.tabIndex}
          placeholderText={this.props.placeholder}
          ref={this.props.elRef}
          disabled={this.props.disabled}
          showYearDropdown={this.props.showYearDropdown}
          locale={this.lang}
        /&gt;
      );
    }
    break;
}
</code></pre>

<p>This loads a react date picker on my landing page.</p>

<p>Since it's been used a lot, I'd like to make it more user-friendly by auto opening the datepicker when the page loads.
I've been searching a lot but I have not found an easy, direct approach to this.</p>

<p>I found this topic (<a href="https://github.com/Hacker0x01/react-datepicker/issues/276" rel="nofollow">https://github.com/Hacker0x01/react-datepicker/issues/276</a>) but since I'm a bit new to Javascript and React, I need a bit more explanations on how to implement this code in mine, so it would be awesome if anyone could explain to me where exactly I should put my code to implement this function</p>

<p>Thanks a lot everyone ! </p>