Skip to content

Commit

Permalink
Merge pull request #12841 from storybookjs/fix_issue_12129
Browse files Browse the repository at this point in the history
Chore: update documentation to address issue #12129
  • Loading branch information
shilman authored Oct 21, 2020
2 parents 9f2b20c + cf9de19 commit 5d7d205
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
22 changes: 22 additions & 0 deletions docs/configure/typescript.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,25 @@ The following code snippets shows the fields for you to use with TypeScript:
| **checkOptions** | All | Options to pass to fork-ts-checker-webpack-plugin if it's enabled | <a href="https://github.com/TypeStrong/fork-ts-checker-webpack-plugin/blob/v4.1.6/README.md#options">See Docs</a> |
| **reactDocgen** | React | Which react docgen processor to run: `"react-docgen-typescript"`, `"react-docgen"`, `false` | string or false |
| **reactDocgenTypescriptOptions** | React | Options to pass to react-docgen-typescript-plugin if react-docgen-typescript is enabled. | [See docs](https://github.com/hipstersmoothie/react-docgen-typescript-plugin) |



### Overriding the configuration to infer additional props

The configuration provided above will remove any props from any third party libraries.

If it's required you can adjust the configuration and include the extra props.

Adjust the configuration as shown below and any third party props will be displayed as soon as you restart your Storybook.

<!-- prettier-ignore-start -->

<CodeSnippets
paths={[
'common/storybook-main-extend-ts-config.js.mdx',
]}
/>

<!-- prettier-ignore-end -->

Next time you restart your Storybook the extra props will also be in the UI.
17 changes: 17 additions & 0 deletions docs/snippets/common/storybook-main-extend-ts-config.js.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
```js
// .storybook/main.js

module.exports = {
stories: [],
addons: [],
typescript: {
reactDocgen: 'react-docgen-typescript',
reactDocgenTypescriptOptions: {
compilerOptions: {
allowSyntheticDefaultImports: false,
esModuleInterop: false,
},
}
}
};
```

0 comments on commit 5d7d205

Please sign in to comment.