In React I can have uncontrolled text inputs by using defaultValue
property. However, there is no such property for checkboxes (there is only checked
, which makes it controlled). I have a huge form with lots of checkboxes, but user can't change them! Probably I can use two-way data binding mixin, but docs suggest not to use them, so I'm stuck.
Use defaultChecked
Reference: https://reactjs.org/docs/uncontrolled-components.html#default-values
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With