[mergeProps] Make mergeProps public#3642
Conversation
commit: |
Bundle size report
Check out the code infra dashboard for more information about this PR. |
✅ Deploy Preview for base-ui ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for base-ui ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for base-ui ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for base-ui ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
02ece77 to
d49021f
Compare
LukasTy
left a comment
There was a problem hiding this comment.
LGTM. 👍
Thanks for addressing this. 🙏
Co-authored-by: Lukas Tyla <llukas.tyla@gmail.com> Signed-off-by: Michał Dudak <michal.dudak@gmail.com>
| ...props | ||
| }: ParametersReferenceTableProps) { | ||
| return ( | ||
| <PropsReferenceAccordion |
There was a problem hiding this comment.
Would it make sense to abstract this into a <ReferenceAccordion/> component which both the parameters and props table would use?
| - 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. |
There was a problem hiding this comment.
There's extra indentation here
| ```ts | ||
| mergeProps({ onClick: a }, { onClick: b }); // b runs before a | ||
| ``` |
There was a problem hiding this comment.
The code blocks are missing a title, maybe the comments could be moved to the title
|
I addressed all the comments. |
mergePropswas 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