Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change example repository with new CRA and Typesc… #8071

Merged
merged 1 commit into from Sep 30, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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