DEV Community

Discussion on: Setting Up Storybook with TypeScript in Create React App

Collapse
 
hugoliconv profile image
Hugo

is it necessary to do all that stuff? In the documentation says:

If you’re using Create React App (CRA) and have configured it to work with TS, you should use the CRA preset, which configures Storybook to reuse CRA’s TS handling.

What I did what this:

  • npx create-react-app app --template typescript
  • npx -p @storybook/cli sb init --type react_scripts
  • rename all files to .ts and .tsx

And it worked, but I'm not sure if it's the right way of doing it