Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Turn into a controlled component #17

Open
dacevedo12 opened this issue Feb 5, 2020 · 0 comments
Open

Turn into a controlled component #17

dacevedo12 opened this issue Feb 5, 2020 · 0 comments

Comments

@dacevedo12
Copy link

dacevedo12 commented Feb 5, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant