How to make datepicker empty as default

I use this code to show datepicker, but my problem is how to make empty as default. I try to change the initial value to null but the datepicker like a disable.

{
  getFieldDecorator("dob", {
    rules: [genRequiredError("Date of Birth")],
    initialValue: userData.dob
  })(
    <DatePicker
      disabledDate={disabledKids}
      format="MM-DD-YYYY"
      placeholder="Select Date of Birth"
    />
  );
}

Thanks

1 answer

  • answered 2019-05-15 04:55 Malik Hezretov

    You can pass local state like date={this.state.date} and make local state empty in constructor