title: React JS - onChange function is being triggered twice
body: <p>I got an issue while working with date input in react. so the date value is coming from <em>graphQL</em> and format of date is <code>dd.mm.yyyy</code> but in order to set a default value for HTML date input I am converting format to <code>yyyy.mm.dd</code> and for saving data again I need to do vice versa.</p>
  
  <p>I am saving date in state and calling on change function to update values and converting formats.</p>
  
  <p>the problem is that this function is being triggered twice <code>onChange</code> and returning <code>NaN-NaN-NaN</code> (on 2nd run) but not each time only sometimes (weird). And, with some dates, it works fine, for example, with <code>02.03.2000</code> no error and executed only once. </p>
  
  <p>with <strong>24</strong> it called <strong><em>twice</em></strong> and error on 2nd call (see screenshot). maybe conversion is wrong somehow? and if I remove <code>defaultValue</code> from input then it called only once.</p>
  
  <p><a href="https://i.stack.imgur.com/Qbtiz.png" rel="noreferrer"><img src="https://i.stack.imgur.com/Qbtiz.png" alt="enter image description here"></a></p>
  
  <pre class="lang-js prettyprint-override"><code>state = {
      newUser: {
        geburtsdatum: "01.02.2000"
      }
  }
  
  ConvertDate(htmlDate, format) {
      var date = new Date(htmlDate);
      var dd = date.getDate();
      var mm = date.getMonth() + 1;
      var yyyy = date.getFullYear();
      if (dd &lt; 10) {
        dd = "0" + dd;
      }
      if (mm &lt; 10) {
        mm = "0" + mm;
      }
      if (format === "graphql") date = dd + "." + mm + "." + yyyy;
      if (format === "html") date = yyyy + "-" + dd + "-" + mm;
      return date;
  }
  
  onChange = e =&gt; {
      let value = e.target.value;
      let name = e.target.name;
      if (e.target.type === "date") {
        value = this.convertDate(value, "graphql");
      console.log(value, name);
      }
      this.setState(prevState =&gt; {
        return {
          newUser: {
            ...prevState.newUser,
            [name]: value
          }
        };
      });
    };
  
  &lt;input
      type="date"
      name="geburtsdatum"
      defaultValue={this.convertDate(this.state.newUser.geburtsdatum, "html")}
      onChange={this.onChange}
      placeholder={this.getDJHTooltip("geburtsdatum")}
  /&gt;
  </code></pre>