I am setting value onSelect and clearing value on button click. The state for DatePicker field is getting cleared but from UI the value is not getting cleared. It remains there until and unless I clicked on cross icon in DatePicker field. I am also facing another issue which is whenever I put value attribute value={moment(searchData.createdDate).toDate()} and when I clicked on field it is throwing me Invalid time error error. Please refer the below code and image for more clarification.
import { DatePicker } from 'rsuite';
< DatePicker
oneTap
placeholder = "Date select"
name = "createdDate"
onSelect = {(date, event) => {
handleInputChange({
target: {
name: "createdDate",
value: moment(date).format('YYYY-MM-DD')
}
})
}
}
// value={moment(searchData.createdDate).toDate()}
/>
Thank you.
