react-docgen-typescript-loader is a Webpack loader designed to extract documentation (docgen) information from TypeScript React components. This information, including component prop types, descriptions, and default values, is primarily utilized to populate dynamic documentation tables, especially within tools like Storybook's Info Addon or Docs Addon. The current stable version is 3.7.2. While there's no fixed release cadence, updates typically align with major changes in React, TypeScript, or Webpack. Its key differentiator is its specific focus on TypeScript components, offering robust type introspection to enrich component documentation automatically, reducing manual documentation effort for developers working in TypeScript-heavy React ecosystems.
npm install react-docgen-typescript-loaderVerified import paths — ran on the pinned version, not inferred.
This configuration demonstrates how to integrate `react-docgen-typescript-loader` into a Storybook Webpack setup, ensuring it processes `.tsx` and `.ts` files after `ts-loader` to generate prop type documentation for components.
Remove `includes` and `excludes` from `react-docgen-typescript-loader` options. Implement file filtering using Webpack's `test`, `include`, and `exclude` properties on the rule itself.
Ensure `react-docgen-typescript-loader` is listed later in the `use` array than your TypeScript compiler loader (e.g., `ts-loader`). Webpack loaders execute right-to-left.
Upgrade your project's TypeScript dependency to version 2.3 or newer.
Remove the `includes` and `excludes` options from the `react-docgen-typescript-loader` configuration within your Webpack setup. Use Webpack's native `test`, `include`, and `exclude` rule properties for file filtering.
Verify that `react-docgen-typescript-loader` is placed *after* your TypeScript compiler loader (e.g., `ts-loader`) in the `use` array of your Webpack module rule. Also, confirm the `include` and `test` regex patterns correctly target your TypeScript React component files.