Open sjonchhe opened 2 years ago
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.
How can i set value of selected date,their is no props for adding value of selected field
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