bootstrap-switch-button-react icon indicating copy to clipboard operation
bootstrap-switch-button-react copied to clipboard

Turn into a controlled component

Open dacevedo12 opened this issue 5 years ago • 0 comments

By default, this component manages its own internal state. The checked prop is merely used as the initial state.

This becomes problematic if there's a need to remotely trigger a state change, mostly needed to compose complex forms.

For better understanding: <BootstrapSwitchButton checked={true} /> will display active but still toggle when the user clicks it.

dacevedo12 avatar Feb 05 '20 15:02 dacevedo12