luqin / react-icheck

:radio_button: iCheck components built with React. Highly customizable checkbox, radio buttons and radio group.
https://luqin.github.io/react-icheck
177 stars 40 forks source link

Checkbox.isChecked() not working: Uncaught TypeError: this.refs.enhancedSwitch.isSwitched is not a function #23

Closed risleylima closed 8 years ago

risleylima commented 8 years ago

I tried to view the state of the checkbox, calling isChecked() method, and get an error:

Uncaught TypeError: this.refs.enhancedSwitch.isSwitched is not a function

So, I made some changes in the file: /lib/Checkbox.js, on lines:

45: this.refs.enhancedSwitch.setSwitched(newCheckedValue);
 to: this.refs.enhancedSwitch.setChecked(newCheckedValue);
50: return this.refs.enhancedSwitch.isSwitched();
 to: return this.refs.enhancedSwitch.isChecked(); 

After Changing this 2 lines, I get these 2 methods working.

I don't know how to send a pull request, because I'm new on github. 😖

Hope this will help. 😉

Thanks.