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

[SwitchBase] Fix error not being thrown when controlled state is changed #13726

Merged

Conversation

joshwooding
Copy link
Member

Fixes #13710

  • [SwitchBase] Fix error not being thrown when controlled state is changed

  • [test] Added regression tests to check errors are thrown when controlled
    state is changed

[test] Added regression test to check errors are thrown when controlled
state is changed
@joshwooding joshwooding force-pushed the switchbase-controlled-uncontrolled-bug branch from 346c48d to 120b5fa Compare November 29, 2018 00:08
@joshwooding
Copy link
Member Author

8B over the size limit 😅

Copy link
Member

@eps1lon eps1lon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like we can remove checked from the state now if react is doing the work by considering input uncontrolled.

@oliviertassinari oliviertassinari added bug 🐛 Something doesn't work component: switch This is the name of the generic UI component, not the React module! labels Nov 29, 2018
@oliviertassinari
Copy link
Member

Looks like we can remove checked from the state now if react is doing the work by considering input uncontrolled.

We still need it for UI changes no?

@oliviertassinari oliviertassinari merged commit e5963f2 into mui:master Nov 29, 2018
@oliviertassinari
Copy link
Member

@joshwooding Well done. I have added an experimental test utils to make repetitive tests green if the first one is. React uses an internal flag to only warn once.

@joshwooding joshwooding deleted the switchbase-controlled-uncontrolled-bug branch November 29, 2018 20:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work component: switch This is the name of the generic UI component, not the React module!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants