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
defaultDate doesnt update on rerender. it only works if default date exists in initial render
I have got 2 datepickers, I am trying to set default date of second date picker when date has been selected on the first datepicker. But default date on second datepicker doesnt get updated. Is there any workaround for this?
The defaultDate is set once only when the component is mounted. The date is not updated then by changing defaultDate as the date value is changed with the user's interaction with the date in the calendar.
For your two calendar cases, you can mount the other calendar component using defaultValue when the first calendar is set not both at the same time, or use a new key to force rerender the calendar.
defaultDate doesnt update on rerender. it only works if default date exists in initial render
I have got 2 datepickers, I am trying to set default date of second date picker when date has been selected on the first datepicker. But default date on second datepicker doesnt get updated. Is there any workaround for this?
https://codesandbox.io/s/zen-monad-s5t7u5?file=/src/App.js
The text was updated successfully, but these errors were encountered: