storybookjs / react-native

📓 Storybook for React Native!
https://storybook.js.org
MIT License
995 stars 142 forks source link

Generates TypeScipt while project is JS #574

Open SilBenjamin opened 1 month ago

SilBenjamin commented 1 month ago

Everywhere in my application I am using (.js) files. I am concerned having the storybook files in my project in (.ts) and (.tsx). Is it a problem if these files are in typescript while my project is .js? Why does storybook recognize my project as typescript? How can I make sure that when I add storybook to my project, that it generates the right (.js) files?

dannyhw commented 1 month ago

@SilBenjamin You can pass a flag to the code generation to use js there is no requirement to use typescript. Typescript is just the default because thats the direction storybook is going in.

SilBenjamin commented 1 month ago

Thank you for your answer @dannyhw !How do I do this?

dannyhw commented 1 month ago

The tutorial template uses it you can see the -js flag on the script

https://github.com/chromaui/intro-storybook-react-native-template/blob/fefead20a0f05933fc0b476bc20dd87b929d37cb/package.json#L31

and here in metro https://github.com/chromaui/intro-storybook-react-native-template/blob/fefead20a0f05933fc0b476bc20dd87b929d37cb/metro.config.js#L5

SilBenjamin commented 1 month ago

@dannyhw thanks again so much for your help!