themesberg / themesberg/flowbite-react
Datepicker is generating TextInput contains an input of type text with both value and defaultValue
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 2.1k
- Forks
- 506
- PR merge metrics
- No merged PRs in 30d
Description
- 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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by inspecting the Datepicker and TextInput components involved in rendering the empty date field, using the provided controlled-value example to reproduce the warning. Confirm that an empty label no longer produces an input with both value and defaultValue, then verify the behavior with the relevant component tests or Storybook example.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100