Skip to content

[all components] Do not pass refs to useButton #2057

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

Merged
merged 4 commits into from
Jun 6, 2025

Conversation

michaldudak
Copy link
Member

Removed the deprecated buttonRef parameter of useButton. Refs are now merged in useRenderElement.

@michaldudak michaldudak added core DO NOT USE. This label has been deprecated and replaced by `all components` and `internal`. all components Work that is widespread, impact most of the modules labels Jun 3, 2025
Copy link

pkg-pr-new bot commented Jun 3, 2025

Open in StackBlitz

npm i https://pkg.pr.new/@base-ui-components/react@2057

commit: d225ad5

@mui-bot
Copy link

mui-bot commented Jun 3, 2025

Bundle size report

Total Size Change: ▼-652B(-0.05%) - Total Gzip Change: ▼-260B(-0.05%)
Files: 41 total (0 added, 0 removed, 18 changed)

Show details for 41 more bundles

@base-ui-components/reactparsed: ▼-82B(-0.03%) gzip: ▼-6B(-0.01%)
@base-ui-components/react/selectparsed: ▼-58B(-0.05%) gzip: ▼-15B(-0.04%)
@base-ui-components/react/toggleparsed: ▼-43B(-0.50%) gzip: ▼-23B(-0.65%)
@base-ui-components/react/menuparsed: ▼-41B(-0.04%) gzip: ▼-8B(-0.02%)
@base-ui-components/react/popoverparsed: ▼-40B(-0.05%) gzip: ▼-18B(-0.06%)
@base-ui-components/react/checkboxparsed: ▼-37B(-0.21%) gzip: ▼-23B(-0.34%)
Base UI checkboxparsed: ▼-37B(-0.21%) gzip: ▼-24B(-0.36%)
@base-ui-components/react/context-menuparsed: ▼-32B(-0.03%) gzip: 0B(0.00%)
@base-ui-components/react/accordionparsed: ▼-29B(-0.13%) gzip: ▼-13B(-0.17%)
@base-ui-components/react/alert-dialogparsed: ▼-29B(-0.06%) gzip: ▼-18B(-0.10%)
@base-ui-components/react/collapsibleparsed: ▼-29B(-0.16%) gzip: ▼-16B(-0.26%)
@base-ui-components/react/dialogparsed: ▼-29B(-0.06%) gzip: ▼-18B(-0.10%)
@base-ui-components/react/number-fieldparsed: ▼-29B(-0.10%) gzip: ▼-13B(-0.13%)
@base-ui-components/react/radioparsed: ▼-29B(-0.20%) gzip: ▼-21B(-0.39%)
@base-ui-components/react/switchparsed: ▼-29B(-0.21%) gzip: ▼-6B(-0.11%)
@base-ui-components/react/tabsparsed: ▼-29B(-0.12%) gzip: ▼-14B(-0.16%)
@base-ui-components/react/toolbarparsed: ▼-29B(-0.16%) gzip: ▼-15B(-0.23%)
@base-ui-components/react/toastparsed: ▼-21B(-0.08%) gzip: ▼-9B(-0.10%)
@base-ui-components/react/avatarparsed: 0B(0.00%) gzip: 0B(0.00%)
@base-ui-components/react/checkbox-groupparsed: 0B(0.00%) gzip: 0B(0.00%)
@base-ui-components/react/direction-providerparsed: 0B(0.00%) gzip: 0B(0.00%)
@base-ui-components/react/fieldparsed: 0B(0.00%) gzip: 0B(0.00%)
@base-ui-components/react/fieldsetparsed: 0B(0.00%) gzip: 0B(0.00%)
@base-ui-components/react/formparsed: 0B(0.00%) gzip: 0B(0.00%)
@base-ui-components/react/inputparsed: 0B(0.00%) gzip: 0B(0.00%)
@base-ui-components/react/menubarparsed: 0B(0.00%) gzip: 0B(0.00%)
@base-ui-components/react/merge-propsparsed: 0B(0.00%) gzip: 0B(0.00%)
@base-ui-components/react/meterparsed: 0B(0.00%) gzip: 0B(0.00%)
@base-ui-components/react/navigation-menuparsed: 0B(0.00%) gzip: 0B(0.00%)
@base-ui-components/react/preview-cardparsed: 0B(0.00%) gzip: 0B(0.00%)
@base-ui-components/react/progressparsed: 0B(0.00%) gzip: 0B(0.00%)
@base-ui-components/react/radio-groupparsed: 0B(0.00%) gzip: 0B(0.00%)
@base-ui-components/react/scroll-areaparsed: 0B(0.00%) gzip: 0B(0.00%)
@base-ui-components/react/separatorparsed: 0B(0.00%) gzip: 0B(0.00%)
@base-ui-components/react/sliderparsed: 0B(0.00%) gzip: 0B(0.00%)
@base-ui-components/react/toggle-groupparsed: 0B(0.00%) gzip: 0B(0.00%)
@base-ui-components/react/tooltipparsed: 0B(0.00%) gzip: 0B(0.00%)
@base-ui-components/react/unstable-no-ssrparsed: 0B(0.00%) gzip: 0B(0.00%)
@base-ui-components/react/unstable-use-media-queryparsed: 0B(0.00%) gzip: 0B(0.00%)
@base-ui-components/react/use-renderparsed: 0B(0.00%) gzip: 0B(0.00%)
@base-ui-components/react/utilsparsed: 0B(0.00%) gzip: 0B(0.00%)

Details of bundle changes

Generated by 🚫 dangerJS against d225ad5

Copy link

netlify bot commented Jun 3, 2025

Deploy Preview for base-ui ready!

Name Link
🔨 Latest commit d225ad5
🔍 Latest deploy log https://app.netlify.com/projects/base-ui/deploys/6842aeda81ac5e00088078c0
😎 Deploy Preview https://deploy-preview-2057--base-ui.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@@ -12,7 +12,6 @@ const BUTTON_TYPES = new Set(['button', 'submit', 'reset']);

export function useButton(parameters: useButton.Parameters = {}): useButton.ReturnValue {
Copy link
Member

Choose a reason for hiding this comment

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

I think it would be helpful to update the return value buttonRef JSDoc to mention that it's mandatory to pass it to useRenderElement

@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label Jun 4, 2025
@github-actions github-actions bot added PR: out-of-date The pull request has merge conflicts and can't be merged and removed PR: out-of-date The pull request has merge conflicts and can't be merged labels Jun 4, 2025
@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged label Jun 6, 2025
@michaldudak michaldudak merged commit 558d4f4 into mui:master Jun 6, 2025
22 checks passed
@michaldudak michaldudak deleted the cleanup-useButton-calls branch June 6, 2025 12:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
all components Work that is widespread, impact most of the modules core DO NOT USE. This label has been deprecated and replaced by `all components` and `internal`.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants