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

[docs] Incorrect React useState Example on Toggle Button #43986

Closed
barrownicholas opened this issue Oct 4, 2024 · 2 comments · Fixed by #43987
Closed

[docs] Incorrect React useState Example on Toggle Button #43986

barrownicholas opened this issue Oct 4, 2024 · 2 comments · Fixed by #43987
Assignees
Labels
component: toggle button This is the name of the generic UI component, not the React module! docs Improvements or additions to the documentation support: docs-feedback Feedback from documentation page

Comments

@barrownicholas
Copy link
Contributor

barrownicholas commented Oct 4, 2024

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

@barrownicholas barrownicholas added status: waiting for maintainer These issues haven't been looked at yet by a maintainer support: docs-feedback Feedback from documentation page labels Oct 4, 2024
@barrownicholas
Copy link
Contributor Author

Here's the PR: #43987

@zannager zannager added docs Improvements or additions to the documentation component: toggle button This is the name of the generic UI component, not the React module! labels Oct 4, 2024
Copy link

github-actions bot commented Oct 8, 2024

This issue has been closed. If you have a similar problem but not exactly the same, please open a new issue.
Now, if you have additional information related to this issue or things that could help future readers, feel free to leave a comment.

Note

@barrownicholas How did we do? Your experience with our support team matters to us. If you have a moment, please share your thoughts in this short Support Satisfaction survey.

@github-actions github-actions bot removed the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Oct 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: toggle button This is the name of the generic UI component, not the React module! docs Improvements or additions to the documentation support: docs-feedback Feedback from documentation page
Projects
None yet
3 participants