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
During unit tests, the following output is shown, and it indicates a problem:
Warning: A component is changing an uncontrolled input to be controlled. This is likely caused by the value changing from undefined to a defined value, which should not happen. Decide between using a controlled or uncontrolled input element for the lifetime of the component. More info: https://reactjs.org/link/controlled-components
at input
at div
at ib (/Users/brandonlenz/dev/ui-modernization-demo/node_modules/@trussworks/react-uswds/lib/index.js:2:214491)
at div
at wb (/Users/brandonlenz/dev/ui-modernization-demo/node_modules/@trussworks/react-uswds/lib/index.js:2:225022)
at name (/Users/brandonlenz/dev/ui-modernization-demo/src/components/form/fields/CheckboxField/CheckboxField.tsx:6:3)
at form
at zy (/Users/brandonlenz/dev/ui-modernization-demo/node_modules/@trussworks/react-uswds/lib/index.js:2:250932)
at Object.<anonymous>.exports.FormProvider (/Users/brandonlenz/dev/ui-modernization-demo/node_modules/react-hook-form/src/useFormContext.tsx:77:5)
at WrappedInput (/Users/brandonlenz/dev/ui-modernization-demo/src/components/form/fields/CheckboxField/CheckBoxField.test.tsx:30:38)
This often happens when an uncontrolled input starts getting managed by something like a form library (RHF in this case). Can be as simple as not regisering the field initially. Sometimes it is more complicated and might be a bug within the component itself
The text was updated successfully, but these errors were encountered:
Current Behavior
First noticed here: #88 (comment)
During unit tests, the following output is shown, and it indicates a problem:
Expected Behavior
No warning output during unit test
Steps To Reproduce
yarn test
Environment
Any/all
Anything else?
https://react.dev/reference/react-dom/components/input#im-getting-an-error-a-component-is-changing-an-uncontrolled-input-to-be-controlled
This often happens when an uncontrolled input starts getting managed by something like a form library (RHF in this case). Can be as simple as not regisering the field initially. Sometimes it is more complicated and might be a bug within the component itself
The text was updated successfully, but these errors were encountered: