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

Typescript compatibility #953

Closed
shilman opened this issue Apr 22, 2017 · 5 comments
Closed

Typescript compatibility #953

shilman opened this issue Apr 22, 2017 · 5 comments

Comments

@shilman
Copy link
Member

shilman commented Apr 22, 2017

Issue by mdcorriveau
Friday Mar 31, 2017 at 19:07 GMT
Originally opened as storybook-eol/react-storybook-addon-info#144


Hi,

I'm currently converting my react application and storybook to typescript. I currently have a bunch of error with the addWithInfo which return this error :
TS2339:Property 'addWithInfo' does not exist on type 'Story'.

While react-storybook is already providing a storybook.d.ts file in their package, do you think it'll be a great idea to do the same with react-storybook-addon-info ?

Thanks

@shilman
Copy link
Member Author

shilman commented Apr 22, 2017

Comment by ndelangen
Friday Mar 31, 2017 at 19:35 GMT


Hey @mdcorriveau, thank you for reporting! Sounds you know a thing or 2 about typescript, would you be able to help us out by creating a PR?

@shilman
Copy link
Member Author

shilman commented Apr 22, 2017

Comment by mnmtanish
Saturday Apr 01, 2017 at 10:45 GMT


I've never done this before but perhaps we can add a type definition file to this repo which will add the method to the story type. I found this page in typescript documentation about merging type declarations. I'll check it out and comment here.

@mdcorriveau
Copy link

Sorry i've just seen your message, i'll try to give you some info tomorrow !

@ndelangen
Copy link
Member

The custom .addBlahBlah() stuff is a bad idea, and we need to provide better ways to add addon-data to stories.

That will make this problem go away too.

Ideas and solution are welcome, but I'm not going to fix this, because long term this is not how we want to do things.

Related #1209

@mucsi96
Copy link

mucsi96 commented Dec 16, 2018

I created a PR containing a new example for React + TypeScript #5011

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

No branches or pull requests

4 participants