Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Datepicker is generating TextInput contains an input of type text with both value and defaultValue #1511

Open
2 tasks done
zulander1 opened this issue Nov 20, 2024 · 2 comments

Comments

@zulander1
Copy link

zulander1 commented Nov 20, 2024

  • I have searched the Issues to see if this bug has already been reported
  • I have tested the latest version

I am initializing the Datepicker to be empty, however, I am getting a warning on the console with: _TextInput contains an input of type text with both value and defaultValue props. Input elements must be either controlled or uncontrolled (specify either the value prop, or the defaultValue prop, but not both).

const [selectedDate, setselectedDate] = useState<Date | null>(null);
<Datepicker className="datepicker-buttons w-full" value={selectedDate} label=""></Datepicker>

Changing the label to =" " make the warning go away

@monikacil
Copy link

I've got the same issue, is there any possible way to avoid that error occurency?
In my case it's appear only during first render.
Changing the label to =" " didn't help.

Context
Nextjs project running locally and testing on Chrome 131.0.6778.109.

@SutuSebastian
Copy link
Collaborator

@rluders

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants