Skip to content

[mergeProps] Make mergeProps public#3642

Merged
michaldudak merged 20 commits into
mui:masterfrom
michaldudak:document-merge-props
Jan 15, 2026
Merged

[mergeProps] Make mergeProps public#3642
michaldudak merged 20 commits into
mui:masterfrom
michaldudak:document-merge-props

Conversation

@michaldudak

@michaldudak michaldudak commented Dec 29, 2025

Copy link
Copy Markdown
Member

mergeProps was already exported from the package, but not documented. As it's useful (shadcn components use it, for example), I added the docs page for it.
The docs were generated using an updated infrastructure, so the API definitions are taken from JSDocs (as in components) and not typed by hand.

Docs: https://deploy-preview-3642--base-ui.netlify.app/react/utils/merge-props

@pkg-pr-new

pkg-pr-new Bot commented Dec 29, 2025

Copy link
Copy Markdown
  • vite-css-base-ui-example

    pnpm add https://pkg.pr.new/mui/base-ui/@base-ui/react@3642
    
    pnpm add https://pkg.pr.new/mui/base-ui/@base-ui/utils@3642
    

commit: d3e768c

@michaldudak michaldudak changed the title Document merge props [mergeProps] Make mergeProps public Dec 29, 2025
@mui-bot

mui-bot commented Dec 29, 2025

Copy link
Copy Markdown

Bundle size report

Bundle Parsed size Gzip size
@base-ui/react 0B(0.00%) 0B(0.00%)

Details of bundle changes


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

@netlify

netlify Bot commented Dec 29, 2025

Copy link
Copy Markdown

Deploy Preview for base-ui ready!

Name Link
🔨 Latest commit c1cf29b
🔍 Latest deploy log https://app.netlify.com/projects/base-ui/deploys/6952ebc2e373a500086884cf
😎 Deploy Preview https://deploy-preview-3642--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.

@netlify

netlify Bot commented Dec 29, 2025

Copy link
Copy Markdown

Deploy Preview for base-ui ready!

Name Link
🔨 Latest commit 22e5c86
🔍 Latest deploy log https://app.netlify.com/projects/base-ui/deploys/6952ec55c23e0000087edf3b
😎 Deploy Preview https://deploy-preview-3642--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.

@netlify

netlify Bot commented Dec 29, 2025

Copy link
Copy Markdown

Deploy Preview for base-ui ready!

Name Link
🔨 Latest commit 35221e6
🔍 Latest deploy log https://app.netlify.com/projects/base-ui/deploys/6952ed05e7227000082bf100
😎 Deploy Preview https://deploy-preview-3642--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.

@netlify

netlify Bot commented Dec 29, 2025

Copy link
Copy Markdown

Deploy Preview for base-ui ready!

Name Link
🔨 Latest commit d3e768c
🔍 Latest deploy log https://app.netlify.com/projects/base-ui/deploys/6967af25c6be0a000809b64d
😎 Deploy Preview https://deploy-preview-3642--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.

@michaldudak michaldudak marked this pull request as ready for review December 30, 2025 09:21
@michaldudak michaldudak requested a review from dav-is December 30, 2025 09:22

@LukasTy LukasTy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM. 👍
Thanks for addressing this. 🙏

Comment thread docs/src/app/(docs)/react/utils/merge-props/page.mdx Outdated
Comment thread docs/src/app/(docs)/react/utils/merge-props/page.mdx Outdated
Comment thread docs/src/app/(docs)/react/utils/merge-props/page.mdx Outdated
michaldudak and others added 2 commits December 30, 2025 16:44
Co-authored-by: Lukas Tyla <llukas.tyla@gmail.com>
Signed-off-by: Michał Dudak <michal.dudak@gmail.com>
...props
}: ParametersReferenceTableProps) {
return (
<PropsReferenceAccordion

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Would it make sense to abstract this into a <ReferenceAccordion/> component which both the parameters and props table would use?

Comment thread docs/src/app/(docs)/react/utils/merge-props/page.mdx Outdated
Comment thread docs/src/app/(docs)/react/utils/merge-props/page.mdx Outdated
Comment on lines +30 to +33
- For React synthetic events, Base UI adds `event.preventBaseUIHandler()`. Calling it sets `event.baseUIHandlerPrevented = true`.
This does not call `preventDefault()` or `stopPropagation()`.
It only tells Base UI to skip earlier merged handlers or internal logic that checks the flag.
- For non-synthetic events (custom events with primitive/object values), this mechanism isn't available and all handlers always execute.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

There's extra indentation here

Comment on lines +26 to +28
```ts
mergeProps({ onClick: a }, { onClick: b }); // b runs before a
```

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The code blocks are missing a title, maybe the comments could be moved to the title

@github-actions github-actions Bot added the PR: out-of-date The pull request has merge conflicts and can't be merged. label Jan 5, 2026
@github-actions github-actions Bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged. label Jan 14, 2026
@michaldudak

Copy link
Copy Markdown
Member Author

I addressed all the comments.

@michaldudak michaldudak merged commit 60044a0 into mui:master Jan 15, 2026
23 checks passed
@michaldudak michaldudak mentioned this pull request Jan 15, 2026
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants