Availity / availity-reactstrap-validation

Easy to use React validation components compatible for reactstrap.
https://availity.github.io/availity-reactstrap-validation/
MIT License
191 stars 70 forks source link

AvCheckbox - have a checked prop #190

Closed diegodesouza closed 3 years ago

diegodesouza commented 4 years ago

Right now I'm able to set a checked={checked} prop except that I get this warning.

react_devtools_backend.js:6 Warning: A component is changing an uncontrolled input of type checkbox to be controlled. Input elements should not switch from uncontrolled to controlled (or vice versa). Decide between using a controlled or uncontrolled input element for the lifetime of the component. More info: https://fb.me/react-controlled-components

Wouldnt the checked prop be checked by default if set to true initially? where as the defaultChecked wont retain its value after i change it later, as in a toggle event.

diegodesouza commented 4 years ago

Is this something we can do?

nylon22 commented 4 years ago

can you link a code sandbox demonstrating this issue?

diegodesouza commented 4 years ago

@nylon22 check it out here

diegodesouza commented 3 years ago

Not an issue anymore