title: How to set value of the DatePicker in React
body: <p>I want to set the date of <code>DatePicker</code> value when i click on the set date button but i am getting this error <code>RangeError Invalid time value</code></p>
  
  <pre><code>import React from "react";
  import "./styles.css";
  import DatePicker from "react-datepicker";
  export default function App() {
    const my_date = "26/05/2020";
    var [edit_check_date, set_edit_check_date] = React.useState(new Date());
  
    const set_date = () =&gt; {
      set_edit_check_date(my_date);
    };
    return (
      &lt;div className="App"&gt;
        &lt;input type="submit" value="set date" onClick={set_date} /&gt;
        &lt;DatePicker
          dateFormat="dd/MM/yyyy"
          className="form-control"
          selected={edit_check_date}
          onChange={date =&gt; set_edit_check_date(date)}
        /&gt;
      &lt;/div&gt;
    );
  }
  </code></pre>