Closed do-kevin closed 2 years ago
Hey @do-kevin thanks for using this library! And don't worry about opening issues.
I see that your <Default />
component is of type unknown
. Do you have either of these options in your tsconfig?
// tsconfig.json
{
"compilerOptions": {
// ...
"strict": true, // You need either this option
"strictBindCallApply": true // or this option
// ...
}
// ...
}
It's mentioned in the Typescript section of the README.
This config will make Typescript properly infer the types of stories that use Template.bind({})
which should also resolve the type in your component. If you already do that and the problem is still there, please let me know! I might need a reproduction repo to check it out
I used strict: true
and it worked. Thanks!
Hi, sorry if this is a newbie question. I'm new to Storybook, Testing Library, and TypeScript. I'm trying to avoid using
any
as much as possible and am wondering why I am getting this typing error for my component story.Also, would you be open to showing discussions on this repository? I don't believe my issue is suited as a bug report and should be in discussions instead. Thanks!