Skip to content

Commit

Permalink
Merge pull request #8071 from Luchanso/next
Browse files Browse the repository at this point in the history
Change example repository with new CRA and Typesc…
  • Loading branch information
shilman committed Oct 1, 2019
1 parent e49f152 commit 742b285
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions docs/src/pages/configurations/typescript-config/index.md
Expand Up @@ -80,8 +80,8 @@ This is for the default configuration where `/stories` is a peer of `src`. If yo

## Setting up TypeScript with babel-loader

When using latest create-react-app (CRA 2.0), Babel 7 has native TypeScript support. Setup becomes easier.
For a full working demo (that also uses react-docgen-typescript-loader) you can check out this [repo](https://github.com/johot/storybook4-cra2-typescript-react-docgen-typescript-demo).
When using latest create-react-app (CRA 3.0), Babel 7 has native TypeScript 3.5.0 support. Setup becomes easier.
For a full working demo (that also uses react-docgen-typescript-loader) you can check out this [repo](https://github.com/Luchanso/storybook-cra-ts-example).

### Dependencies you may need

Expand Down Expand Up @@ -111,7 +111,7 @@ module.exports = ({ config, mode }) => {

The default `tsconfig.json` that comes with CRA works great. If your stories are outside the `src` folder, for example the `stories` folder in root, then `"rootDirs": ["src", "stories"]` needs to be added to be added to `compilerOptions` so it knows what folders to compile. Make sure `jsx` is set to preserve. Should be unchanged.

## Create a TSX storybook index
## Create a TSX storybook index

The default storybook index file is `stories/index.stories.js` -- you'll want to rename this to `stories/index.stories.tsx`.

Expand Down

0 comments on commit 742b285

Please sign in to comment.