Bug: defaultSelected doesn't update if the value changes after the first render #1747
-
Bug descriptiondefaultSelected from useInput doesn't update if the value changes after the first render. To reproducehttps://codesandbox.io/s/error-useinput-from-react-day-picker-hlspx8 Steps
Expected behaviorIt would make sense if useInput allowed defaultSelected to be modified. ScreenshotsIf applicable, add screenshots to help explain your problem. Additional contextThe input field is undefined if the value changes after the first render It works fine when the date is provided in the first render I am currently having to overwrite the value for the input tag to be able to allow the input to display the right value after the first render. <Input
{...inputProps}
value={value ? new Date(value) : undefined} |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
I am facing the same issue and would love to see a resolution. |
Beta Was this translation helpful? Give feedback.
-
@markcnunes please use |
Beta Was this translation helpful? Give feedback.
@markcnunes please use
setSelected
returned by the hook to set the selected day:https://codesandbox.io/s/wp2emv