title: How to implement validation/restriction in react-datepicker
body: <p>I am trying to implement restriction or validation in a <a href="https://github.com/Hacker0x01/react-datepicker" rel="noreferrer">react-datepicker</a> component. I am using redux-form for validation and normalization(to implement restriction) </p>
  
  <p><a href="https://redux-form.com/6.0.0-rc.1/examples/normalizing/" rel="noreferrer">https://redux-form.com/6.0.0-rc.1/examples/normalizing/</a></p>
  
  <p><strong>Question : I have observed that neither normalizing function nor validation functions of redux-form is called when we try to enter something in the field</strong></p>
  
  <p><a href="https://i.stack.imgur.com/5NizJ.png" rel="noreferrer"><img src="https://i.stack.imgur.com/5NizJ.png" alt="date picker field"></a></p>
  
  <p>although this value is not submitted when we submit the form but i need to show some validation error or restrict user from typing invalid characters.</p>
  
  <p>I made a wrapper for the date picker component and used it in my form through redux field</p>
  
  <p>my date picker component :-</p>
  
  <pre><code>return (
        &lt;div className={"render-date-picker "}&gt;
          &lt;div className="input-error-wrapper"&gt;
            {(input.value) ? &lt;label&gt; {placeholder} &lt;/label&gt; : ''}
            &lt;DatePicker className="input form-flow" {...input}
              placeholderText={placeholder}
              selected={input.value ? moment(input.value) : null}
              maxDate={maxDate || null}
              minDate={minDate || null}
              dateFormat={isTimePicker ? "LLL" : "DD/MM/YYYY"}
              showYearDropdown
              showMonthDropdown
              disabledKeyboardNavigation
            /&gt;
  
            {touched &amp;&amp; error &amp;&amp; &lt;span className="error-msg"&gt;{t(error)}&lt;/span&gt;}
            &lt;span className="bar" style={{ 'display': this.state.is_focus ? 'block' : 'none' }} &gt;&lt;/span&gt;
          &lt;/div&gt;
        &lt;/div&gt;
      );
  </code></pre>
  
  <p>redux form field :-</p>
  
  <pre><code>&lt;Field
   name="date_of_birth"
   type="text"
   className="input form-flow extra-padding-datepicker"
   component={RenderDatePicker}
   maxDate={moment().subtract(18, "years")}
   validate={[required, dateOfBirth]}
   normalize={isValidDateFormat}
   placeholder={t("DOB (DD/MM/YYYY)")}
  /&gt;
  </code></pre>
  
  <p>my normalizing function:-</p>
  
  <pre><code>export const isValidDateFormat = (value, previousValue) =&gt; {
      if (value == null || !value.isValid()) {
          return previousValue;
      }
      return value;
  }
  </code></pre>