Skip to content

Commit

Permalink
Mention TSX index file requirement in README (#6887)
Browse files Browse the repository at this point in the history
Mention TSX index file requirement in README
  • Loading branch information
ndelangen authored and shilman committed Jun 5, 2019
1 parent db75c0a commit 006615a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docs/src/pages/configurations/typescript-config/index.md
Expand Up @@ -111,6 +111,10 @@ 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

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

## Import tsx stories

Change `config.ts` inside the Storybook config directory (by default, it’s `.storybook`) to import stories made with TypeScript:
Expand Down

0 comments on commit 006615a

Please sign in to comment.