You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Not exactly sure the @types/react is needed, but it's part of the docs for using knobs with TypeScript.
Component.stories.ts
import{storiesOf,Story}from'@storybook/vue'import{withKnobs,text}from'@storybook/addon-knobs'importMyComponentfrom'./MyComponent.vue'conststories: Story=storiesOf('MyComponent.vue',module)// This throws a type checking errorstories.addDecorator(withKnobs)// This compiles and works as expectedstories.addDecorator(<any>withKnobs)stories.add('as component',()=>({components: { MyComponent },props: {text: {default: text('Text','some text')}},template: '<my-component></my-component>'})
System:
OS: Windows10
Device: Toshiba Satellite
Browser: N/A
Framework: Vue
Addons: knobs
Knobs Version: 4.1.13
Knobs Types Version: 4.0.1 (This is latest)
Storybook Version: 4.1.11
Additional context
This isn't a huge deal, just a minor annoyance as I cringe any time I have to use the any type.
The text was updated successfully, but these errors were encountered:
Thanks for the bug! Unfortunately, we don't maintain the types on DefinitelyTyped and I'm not sure about what's the procedure for getting those updated.
The good news is that we're in the process of converting our codebase into Typescript, so you should be seeing those types defined "in house" in an upcoming release. You can check the progress and contribute yourself here: #5030
Describe the bug
The type of
withKnobs
is not valid for theaddDecorator
function. Looks like the@types/storybook_addon-knobs
is out of date maybe?To Reproduce
Using the following relevant libraries:
Not exactly sure the
@types/react
is needed, but it's part of the docs for using knobs with TypeScript.Component.stories.ts
System:
4.1.13
4.0.1
(This is latest)4.1.11
Additional context
This isn't a huge deal, just a minor annoyance as I cringe any time I have to use the
any
type.The text was updated successfully, but these errors were encountered: