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

[ToggleButton] Add prop types for onClick and onChange #30883

Merged
merged 4 commits into from Feb 14, 2022

Conversation

sydneyjodon-wk
Copy link
Contributor

Problem

ToggleButton calls props onClick and onChange with two arguments, but neither prop is typed to have two arguments so the second argument cannot be used. See codesandbox example of error when trying to declare an onClick handler with two arguments for ToggleButton.

Solution

Add typing to onClick and onChange props. (alternate solution would be to update ToggleButton to not call these props with two args)

@mui-bot
Copy link

mui-bot commented Feb 2, 2022

No bundle size changes

Generated by 🚫 dangerJS against 5d40df2

@danilo-leal danilo-leal added component: toggle button This is the name of the generic UI component, not the React module! new feature New feature or request labels Feb 2, 2022
@siriwatknp
Copy link
Member

👋 The migration PR has been merged.

Please follow these steps to make sure that the contents are all updated. (Sorry for the inconvenience)

  1. pull latest master from upstream to your branch
  2. if your PR has changes on the *.md or demo files, you are likely to encounter conflict because all of them have been moved to the new folder.
    2.1 revert the change on those markdown files you did
    2.2 pull latest master from upstream (you should not see conflict)
    2.3 make the changes again at docs/data/material/*
  3. run yarn docs:api
    • you might see the changes in docs/pages/material/api/* if your PR touches some of the components
    • it is okay if there is no changes

If you are struggle with the steps above, feel free to tag @siriwatknp

@kealjones-wk
Copy link
Contributor

👀 psssstttt MUI peeps, i just want to remind you this is here.

Copy link
Member

@siriwatknp siriwatknp left a comment

Choose a reason for hiding this comment

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

👍 Thanks for the fix! (I added a spec file to make sure that the typing works.)

@michaldudak michaldudak merged commit d68201c into mui:master Feb 14, 2022
@sydneyjodon-wk sydneyjodon-wk deleted the toggle-button-add-prop-types branch February 17, 2022 16:00
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! new feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants