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] Remove the incorrect info about useButton's ref parameter #36883

Merged
merged 2 commits into from
Apr 17, 2023

Conversation

michaldudak
Copy link
Member

@michaldudak michaldudak commented Apr 14, 2023

The docs incorrectly state that the ref parameter is required in useButton. This PR fixes it and explains when to use the parameter.

Closes #36880

@michaldudak michaldudak added docs Improvements or additions to the documentation component: button This is the name of the generic UI component, not the React module! package: base-ui Specific to @mui/base labels Apr 14, 2023
@mui-bot
Copy link

mui-bot commented Apr 14, 2023

Netlify deploy preview

Bundle size report

No bundle size changes

Generated by 🚫 dangerJS against b3e4927

Copy link
Member

@mj12albert mj12albert left a comment

Choose a reason for hiding this comment

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

Looks good !

It will get merged with a ref used internally in the hook.

:::warning
Do not add the `ref` parameter to the button element manually, as the correct ref is already a part of the object returned by the `getRootProps` function.
Copy link
Member

Choose a reason for hiding this comment

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

👍

@michaldudak michaldudak merged commit 5a50316 into mui:master Apr 17, 2023
@michaldudak michaldudak deleted the iss/36880-usebutton-ref branch April 17, 2023 08:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: button This is the name of the generic UI component, not the React module! docs Improvements or additions to the documentation package: base-ui Specific to @mui/base
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Base][docs] ref is not required for useButton
4 participants