fix: story ComponentAnnotations['subcomponents'] to correctly use its own type for subcomponents rather than attempt to inherit from the component
I believe that this fixes the underlying bug for the much discussed bug in Storybook: https://github.com/storybookjs/storybook/issues/23170
Hi ! When is this PR going to be merged ?
@starzje Is there another maintainer you can nudge to review this? Many thanks!
LGTM
The ComponentAnnotations.component type is:
component?: (TRenderer & {
T: Record<string, unknown> extends Required<TArgs> ? any : TArgs;
})['component'];
So, as Required<TArgs> don't apply to subcomponents, changing subcomponents to
subcomponents?: Record<string, (TRenderer & { T: any })['component']>;
...to match, looks like the right way to go.
@kasperpeulen this seems like something that you would know about, could you review.
For context, subcomponents is only used for the Controls/ArgTypes table, and doesn't have any impact on what a story actually renders.
:rocket: PR was released in v0.1.13 :rocket: