-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Description
The subcomponents of the Popover
component are not exposing their TypeScript types, for example as we can witness here:
gutenberg/packages/components/src/popover/test/utils/index.tsx
Lines 49 to 50 in 179c868
{ /* @ts-expect-error Slot is not currently typed on Popover */ } | |
<Popover.Slot name={ SLOT_NAME } /> |
This is due to how the component is put together and exported:
gutenberg/packages/components/src/popover/index.tsx
Lines 520 to 525 in 179c868
// @ts-expect-error For Legacy Reasons | |
Popover.Slot = forwardRef( PopoverSlot ); | |
// @ts-expect-error For Legacy Reasons | |
Popover.__unstableSlotNameProvider = slotNameContext.Provider; | |
export default Popover; |
As we can see demonstrated in the Menu
component, there are ways to expose the types correctly with dot-notation subcomponents. When done correctly, the subcomponents can also be documented in the Storybook props tables, as we can see in the one for Menu
.
There is also some more information in the Naming Conventions section of the Contributing Guide.