-
-
Notifications
You must be signed in to change notification settings - Fork 32.7k
Closed
Labels
docsImprovements or additions to the documentation.Improvements or additions to the documentation.scope: toggle buttonChanges related to the toggle button.Changes related to the toggle button.support: docs-feedbackFeedback from documentation page.Feedback from documentation page.
Description
Related page
https://mui.com/material-ui/react-toggle-button/
Kind of issue
Other
Issue description
On this example, the method of updating selected is incorrect and will cause rendering issues; it should be:
onChange={() => setSelected(selected => !selected)}As opposed to:
onChange={() => setSelected(!selected)}Opening this issue, and then I'll create a PR to fix it.
Here's the PR: #43987
Context
No response
Search keywords: toggle button
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
docsImprovements or additions to the documentation.Improvements or additions to the documentation.scope: toggle buttonChanges related to the toggle button.Changes related to the toggle button.support: docs-feedbackFeedback from documentation page.Feedback from documentation page.