-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
Default export CSF 'component' typing for class component #12056
Comments
Can you elaborate on this? |
@shilman
Casting default export as Meta will generate TS compilation error here because 'component' field expects |
@dmarcautan I think you're right. I pretty much only ever use |
Ooh-la-la!! I just released https://github.com/storybookjs/storybook/releases/tag/v6.0.12 containing PR #12072 that references this issue. Upgrade today to try it out! Closing this issue. Please re-open if you think there's still more to do. |
Olé!! I just released https://github.com/storybookjs/storybook/releases/tag/v6.0.15 containing PR #12110 that references this issue. Upgrade today to try it out! |
Describe the bug
Typescript will error on the following block when MyComponent is defined as class component:
export default { title: "MyComponents/MyComponent", component: MyComponent, } as Meta;
'component' property typed with:
type ReactComponent = Component | FunctionComponent<any>;
'Component' is instance type definition but 'FunctionComponent' is functional component TYPE.
The text was updated successfully, but these errors were encountered: