Skip to content
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

fix: story ComponentAnnotations['subcomponents'] to correctly use its own type for subcomponents rather than attempt to inherit from the component #103

Open
wants to merge 1 commit into
base: next
Choose a base branch
from

Conversation

lburgess
Copy link

I believe that this fixes the underlying bug for the much discussed bug in Storybook:
storybookjs/storybook#23170

… own type for subcomponents rather than attempt to inherit from the component
@BryanBerger98
Copy link

Hi ! When is this PR going to be merged ?

@lburgess
Copy link
Author

@starzje Is there another maintainer you can nudge to review this? Many thanks!

@penx
Copy link

penx commented Dec 2, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants