You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It is not possible to reset (set the value to an empty string) the value of a Datepicker component.
I'm using the component inside a Formik form.
The user can reset the form but I can't find how to set the activeDate to an empty string.
staticgetDerivedStateFromProps(props,state){// Does not allow empty strings hereif(props.activeDate){constmomentDate=Moment(props.activeDate,props.format,true);if(momentDate.isValid()){return{activeDate: momentDate,input: props.activeDate};}}returnnull;}
The solution
accept an empty string as activeDate (current value)
The problem
It is not possible to reset (set the value to an empty string) the value of a Datepicker component.
I'm using the component inside a Formik form.
The user can reset the form but I can't find how to set the activeDate to an empty string.
The solution
accept an empty string as activeDate (current value)
The text was updated successfully, but these errors were encountered: