Based on other issues, I know some people are using TS with storybook. I've had a bit of trouble getting https://github.com/NewSpring/typescript-react-storybook-addon and https://github.com/jupl/astraea to run. Is there a working webpack/TS repo somewhere that I can use as a reference?
Ideally, I would like to try out storybook on a project using the following webpack config:
https://gist.github.com/matt-erhart/cbab5c767d437c1186a1697095aaa63d.js . Could someone explain how to adapt this config to work with storybook?
I wrote a simple one, hope it'll be helpful :)
Griddle now has a working TypeScript Storybook, too.
None of the examples work properly for me. Griddles leave '.jsx' and 'js' files in the same directory as the typescript source files, and pollutes the entire repo with temp files, and the one by @issacsonjj doesn't seem to work with the new storybook.
Did you face these two problems @issacsonjj and @dahlbyk ?
@GeeWee I don't recall seeing anything like that in my troubleshooting or now. Can you post your tsconfig.json and .storybook/webpack.config.js?
Thanks for the response @dahlbyk.
I ended up figuring it out. What happened was, that somehow my "stories" folder had ended up in the exclude section of the tsconfig - which I assume meant that the outdir was completely ignored for everything, as that's the webpack entry point. Removing that fixed the issue.
I tried to add Storybook to my TypeScript React app based on the above information. However I am getting an error when running Storybook:
ERROR in ./.storybook/config.js
Module not found: Error: Can't resolve '../stories'
I have a ../stories folder, so I am not sure why I am getting this error. Can someone please take a look at my project and help me figure this problem: https://github.com/archfirst/react-mobx-mui-ts-seed
Thanks in advance.
FYI, I got help from a colleague to get this working. The project is now updated with a working storybook example: https://github.com/archfirst/react-mobx-mui-ts-seed
Most helpful comment
FYI, I got help from a colleague to get this working. The project is now updated with a working storybook example: https://github.com/archfirst/react-mobx-mui-ts-seed