Closed ThariqS closed 7 years ago
hey, @ThariqS. That's a great idea! Definitely something we can work on.
Just so you know, the way I currently simulate this behavior is through the onActive
and onInactive
callbacks the component provides. I keep the switch state as a property of the parent component's state and update it with these two callbacks.
Do you want to take a stab and submit a PR?
Fixed by #11.
I love the UI options and customizability with this component. It would be great if it could follow the React standards for input/form elements though: https://facebook.github.io/react/docs/forms.html
Basically either having the ability to pass in a value and make in a controlled component, or use a defaultValue and then be able to do something like
this.refs.switch.value
to get the value of the component.