-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Fix: Expose TypeScript types for subcomponents #69619
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
Conversation
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Refactoring all compound components to use the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good!
We also want to list Popover.Slot
in the Storybook subcomponents
. For the props table to work, this will require a named export for the PopoverSlot
function before Object.assign
ing it. So something like:
export const PopoverSlot = forwardRef(
( { name = SLOT_NAME }: { name?: string }, ref: ForwardedRef< any > ) => {
return (
<Slot
bubblesVirtually
name={ name }
className="popover-slot"
ref={ ref }
/>
);
}
);
Thanks for the review @mirka! I have added the |
@Rishit30G you can take inspiration from existing compound components such as |
Thanks @ciampo! 🙇🏻 I have updated the PR accordingly, sharing a screenshot of the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking good, code-wise! We just need to add a CHANGELOG entry
Sure, I have added the entry 👍🏻 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🚀
* Update popover subcomponents * Remove internal usage note from Popover.Slot documentation * Add PopoverSlot component to Popover and update stories * Enhance PopoverSlot component with TypeScript props and update documentation * Refactor PopoverSlot component props * Remove comment * add PopoverSlot as named export * Add changelog entry * Add fullstop * Update documentation section * Update changelog documentation * Update letter casing * Update packages/components/CHANGELOG.md * Update packages/components/CHANGELOG.md --------- Co-authored-by: Rishit30G <rishit30g@git.wordpress.org> Co-authored-by: ciampo <mciampini@git.wordpress.org> Co-authored-by: mirka <0mirka00@git.wordpress.org>
What?
Closes #69615
Why?
This PR solves the issue of the subcomponents of the Popover component not exposing their TypeScript type
How?
Just like the Menu, types for the subcomponents of the Popover are also exposed and no longer require
@ts-expect-error
Testing Instructions
N/A
Screenshots or screencast
N/A