You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TriStateCheckbox: Warning: value prop on input should not be null. Consider using an empty string to clear the component or undefined for uncontrolled components.
#7313
Closed
junjung929 opened this issue
Oct 7, 2024
· 0 comments
· Fixed by #7315
Using TriStateCheckbox component with null value gives console error.
Warning: value prop on input should not be null. Consider using an empty string to clear the component or undefined for uncontrolled components.
I am using the TriStateCheckbox as it is described in the component description https://primereact.org/tristatecheckbox/#basic. However, this provides errors in the console in the browser dev tools. I cannot not prevent the error from the log. Even if I initialized the state to false or true, it gives more errors when changing the state to null.
Warning: A component is changing a controlled input to be uncontrolled. This is likely caused by the value changing from a defined to undefined, which should not happen. Decide between using a controlled or uncontrolled input element for the lifetime of the component.
melloware
added
Type: Bug
Issue contains a defect related to a specific component.
and removed
Status: Needs Triage
Issue will be reviewed by Core Team and a relevant label will be added as soon as possible
labels
Oct 8, 2024
Describe the bug
Using TriStateCheckbox component with
null
value gives console error.I am using the TriStateCheckbox as it is described in the component description https://primereact.org/tristatecheckbox/#basic. However, this provides errors in the console in the browser dev tools. I cannot not prevent the error from the log. Even if I initialized the state to
false
ortrue
, it gives more errors when changing the state tonull
.I'm using the code example:
Any comment would be really appreciated! Thank you!
Reproducer
No response
System Information
Steps to reproduce the behavior
Go to the demo page https://primereact.org/tristatecheckbox/#basic (primereact version 10.8.3)
Click "Edit in StackBlitz" on the Basic TriStateCheckbox example.
Go to the StackBlitz page for "PrimeReact Demo" and wait the packages are installed for the component.
Open the browser dev tools.
Error log appears in console.
Click the checkbox to change the state from
null
totrue
.Another error log appears in console.
Expected behavior
The errors should not appear in the console of dev tools.
The text was updated successfully, but these errors were encountered: