Closed leojh closed 8 years ago
Warning: Input elements must be either controlled or uncontrolled (specify either the value prop, or the defaultValue prop, but not both). Decide between using a controlled or uncontrolled input element and remove one of these props. More info: https://fb.me/react-controlled-components
I'm encountering this as well after upgrading to 0.3.0. Reverted for now. 100% sure I'm not setting both checked and defaultChecked.
The fix doesn't look too difficult. Just removing the following line already made it work fine (defaultChecked is always set as a defaultProp so as soon as someone defines the checked property it has both on the rendered component).
I'm not 100% what other areas could be touched by this (I only use the Checkbox) so I didn't make a pull-request.
https://github.com/luqin/react-icheck/blob/master/src/EnhancedSwitch.js#L111
Exactly what @janpieterz is saying. I am also not setting both properties, just checked
Thank for your advice and PR. :+1: 0.3.1 has been released.
Getting the following warning when only setting the
checked
property: