Checkbox: Warning: specify either the checked prop, or the defaultChecked prop, but not both #6197
Labels
Status: Needs Triage
Issue will be reviewed by Core Team and a relevant label will be added as soon as possible
Type: Bug
Issue contains a defect related to a specific component.
Milestone
Describe the bug
Checkbox uses both checked and defaultChecked properties on underlying checkbox input.
This raise warning on console (or when running jest tests):
Reproducer
No response
PrimeReact version
10.5.3
React version
17.x
Language
TypeScript
Build / Runtime
Create React App (CRA)
Browser(s)
No response
Steps to reproduce the behavior
Warning: Checkbox contains an input of type checkbox with both checked and defaultChecked props. Input elements must be either controlled or uncontrolled (specify either the checked prop, or the defaultChecked prop, but not both). Decide between using a controlled or uncontrolled input element and remove one of these props. More info: https://reactjs.org/link/controlled-components
at input
at div
at D:\onetest-server\frontend\node_modules\primereact\checkbox\checkbox.cjs.js:141:26
at div
Expected behavior
No response
The text was updated successfully, but these errors were encountered: