title: I need to clear values of datePicker when selecting item of selection box in react js
body: <pre class="lang-js prettyprint-override"><code>const startDateRef = useRef();
      
  const dateFilter = (event) =&gt; {
    startDateRef.current.value = &quot;&quot;;
  } 
  </code></pre>
  <pre class="lang-html prettyprint-override"><code>&lt;Form.Group controlId=&quot;dob&quot; ref={startDateRef}&gt;
    &lt;Form.Label&gt;Start Date&lt;/Form.Label&gt;
  
    &lt;Form.Control
      ref={startDateRef}
      type=&quot;date&quot;
      name=&quot;stDate&quot;
      value={dateBetweenState.stDate}
      placeholder=&quot;Date of Birth&quot;
      onChange={(e) =&gt; {
        handleChange(e);
      }}
    /&gt;
  
    &lt;select
      type=&quot;text&quot;
      className=&quot;form-select&quot;
      name=&quot;stDate&quot;
      onChange={(e) =&gt; {
        dateFilter(e.target.value);
      }}
    &gt;
      &lt;option value={0}&gt;Choose...&lt;/option&gt;
      &lt;option value={7}&gt;7 Days&lt;/option&gt;
      &lt;option value={14}&gt;14 Days&lt;/option&gt;
      &lt;option value={30}&gt;30 Days&lt;/option&gt;
    &lt;/select&gt;
  
  ...
  </code></pre>
  <p>This is my code segment. I just typed here relevant code only. actual code too long . Anyway here have date-picker and select-box . If picked date and then select item from selection box. I need to clear early picked data from data-picker . I just tried it from react ref . I did that from when select item onChange function work and it contains the ref assigns the value to clear. but it does not work.</p>