Replies: 2 comments
|
Hi @Dinu-Alin! I'm Dosu and I’m helping the storybook team. This is a limitation in Storybook's prop extraction when using react-docgen-typescript with workspace packages and complex type inheritance like MUI. Recent Storybook releases (after 2026-01-20) include fixes for react-docgen-typescript that improve prop extraction from workspace packages and external types. Please upgrade Storybook to the latest version and retest—these changes specifically address issues with missing inherited props from libraries like MUI when importing from workspace packages PR #33586, PR #33589, PR #33598. Also, try customizing your propFilter to explicitly include MUI props: propFilter: (prop) =>
prop.parent ? !/node_modules\/(?!@mui)/.test(prop.parent.fileName) : true,This ensures inherited props from @mui/material are not filtered out docs. If you still see issues, check that your stories import the component source directly (not just the package root), as Storybook autodocs in monorepos sometimes require direct source imports for full prop extraction docs. If none of these resolve it, you can manually document inherited props or re-declare key MUI props in your interface as a workaround. Let me know if you need more help or if you can share how your workspace package is referenced (source vs. built output). To reply, just mention @dosu. Share context across your team and agents. Try Dosu. |
|
This is a limitation in how the Root cause: The plugin creates a TS program from files matching its Note that Fix: Add your workspace package source files to the typescript: {
reactDocgen: "react-docgen-typescript",
reactDocgenTypescriptOptions: {
// ...your existing options
include: ["**/**.tsx", "../../packages/ui/src/**/*.tsx"],
},
},The I reproduced this and confirmed the fix — the workspace Button goes from 0 MUI props to all 45 (variant, size, color, disabled, fullWidth, href, etc.): https://github.com/kasperpeulen/storybook-rdt-workspace-repro |
Uh oh!
There was an error while loading. Please reload this page.
Summary
Environment:
Monorepo structure:
storybook-test/
├── package.json ← "workspaces": ["packages/*"]
├── tsconfig.json ← project references
├── packages/
│ ├── ui/ ← @storybook-test/ui (component library)
│ │ ├── package.json
│ │ ├── tsconfig.json
│ │ └── src/
│ │ ├── index.ts
│ │ └── components/Button.tsx
│ └── storybook/ ← @storybook-test/storybook
│ ├── package.json
│ ├── tsconfig.json
│ ├── .storybook/
│ │ ├── main.ts
│ │ └── preview.tsx
│ └── src/
│ ├── components/Button.tsx ← local Button (works)
│ └── stories/Button.stories.ts
Issue:
When I import the Button from the local file, Storybook's autodocs correctly displays all inherited MUI ButtonProps (variant, size, disabled, color, etc.) in the 'prop/controls panel'. But when I import the same component from the workspace package @storybook-test/ui, only my custom props show up and all MUI props are missing.
Both Button components are identical:
Story file:
Storybook config:
UI tsconfig:
{ "compilerOptions": { "target": "ES2022", "module": "ESNext", "moduleResolution": "bundler", "jsx": "react-jsx", "strict": true, "noEmit": true, "verbatimModuleSyntax": true }, "include": ["src"] }What I've tried:
What am I missing?
Thank you!
Additional information
No response
Create a reproduction
No response
All reactions