Skip to content

How to force default value of date to selected date automatically? #3861

Closed Answered by miller-productions
haendzel asked this question in Q&A
Discussion options

You must be logged in to vote

My hypothesis is that it has something to do with the way you are using selected={field.value} in the attributes of <DatePicker

I've used DatePicker along with react-hook-form in a similar way to what you have but in my version, I use the local state as the value to pass to the selected attribute. e.g. in your case, that looks like it would be selected={startDate} instead.

What do you think?

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by haendzel
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants