Skip to content

[useButton] Stop setting type on non-native buttons#4819

Merged
atomiks merged 1 commit into
mui:masterfrom
chuganzy:usebutton-type
May 14, 2026
Merged

[useButton] Stop setting type on non-native buttons#4819
atomiks merged 1 commit into
mui:masterfrom
chuganzy:usebutton-type

Conversation

@chuganzy
Copy link
Copy Markdown
Contributor

This is a minor PR to avoid passing type={undefined} from useButton when nativeButton is false.

Previously, custom non-native button renderers could receive an unnecessary type prop:

import { Button } from "@base-ui/react/button";

function App() {
  return <Button render={<CustomButton />} nativeButton={false} />
}


function CustomButton(props) {
  // Previously props included type={undefined}
  return <span {...props} />
}

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented May 13, 2026

commit: 3174795

@code-infra-dashboard
Copy link
Copy Markdown

code-infra-dashboard Bot commented May 13, 2026

Bundle size

Bundle Parsed size Gzip size
@base-ui/react ▼-14B(0.00%) ▼-7B(0.00%)

Details of bundle changes

Performance

Total duration: 1,181.99 ms +89.84 ms(+8.2%) | Renders: 50 (+0) | Paint: 1,819.52 ms +155.74 ms(+9.4%)

Test Duration Renders
Menu mount (300 instances) 145.22 ms 🔺+28.57 ms(+24.5%) 2 (+0)
Menu open (500 items) 84.15 ms 🔺+21.86 ms(+35.1%) 12 (+0)

10 tests within noise — details


Check out the code infra dashboard for more information about this PR.

@chuganzy chuganzy marked this pull request as ready for review May 13, 2026 18:14
@netlify
Copy link
Copy Markdown

netlify Bot commented May 13, 2026

Deploy Preview for base-ui ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 3174795
🔍 Latest deploy log https://app.netlify.com/projects/base-ui/deploys/6a04bf1ef728430008fecbd6
😎 Deploy Preview https://deploy-preview-4819--base-ui.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

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

@mj12albert mj12albert added type: enhancement It’s an improvement, but we can’t make up our mind whether it's a bug fix or a new feature. internal Behind-the-scenes enhancement. Formerly called “core”. labels May 13, 2026
Copy link
Copy Markdown
Contributor

@atomiks atomiks 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 @chuganzy

@atomiks atomiks merged commit 1aaf7e7 into mui:master May 14, 2026
23 of 24 checks passed
@chuganzy chuganzy deleted the usebutton-type branch May 14, 2026 05:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

internal Behind-the-scenes enhancement. Formerly called “core”. type: enhancement It’s an improvement, but we can’t make up our mind whether it's a bug fix or a new feature.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants