Unexpected props values when using proptypes + passing to default prop a value which imported from another package (e.g react-virtualized)
See original GitHub issueDescribe the bug I am using Storybook in a monorepo project. I have a table repo which includes Table.js component and Table.stories.js story. Within the Table component, I am importing defaultTableRowRenderer from react-virtualized (import {defaultTableRowRenderer} from react-virtualized).
-
when i run storybook i get an exception: “Failed prop type: Invalid prop
rowRendererof typestring”. the value (default value) which passed to rowRenderer is defaultTableRowRenderer. if i console.log({defaultTableRowRenderer}) it is printed as a function. -
the Table components props gets weird and undeclared values somehow. for instance: the Table.js component have a prop ‘onSelectedIdsChange’. this prop doesn’t have any default value and it doesn’t get any value from the story it self. when running storybook and printing ‘onSelectedIdsChange’, i get a function with the name “actionHandler”.
- if i am reconfigure the babel overrides array in the main.js file to be []. Everything works just fine, except that i don’t get the auto configure args table.
Expected behavior
i wish to see the table working as it works when configuring babel to
babel: (options) => ({ ...options, overrides: [], }),
and also get the auto configure args table.
Screenshots



System System: OS: macOS 11.1 CPU: (8) x64 Intel® Core™ i7-6700HQ CPU @ 2.60GHz Binaries: Node: 12.19.0 - /usr/local/bin/node Yarn: 1.22.10 - /usr/local/bin/yarn npm: 6.14.8 - /usr/local/bin/npm Browsers: Chrome: 89.0.4389.114 npmPackages: @storybook/addon-actions: ^6.1.5 => 6.2.7 @storybook/addon-essentials: ^6.1.5 => 6.2.7 @storybook/addon-links: ^6.1.5 => 6.2.7 @storybook/react: ^6.1.5 => 6.2.7
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (3 by maintainers)

Top Related StackOverflow Question
If you are installing Storybook with
sb init, it will create a.storybook/preview.jswhich contains the following code:This is what is generating the action handler passed into
onSelectedIdsChange. You can delete/modify that line if you don’t want to actions foron*propsI didn’t pass “rowRenderer” as an arg. It should just get the default prop assign to it (defaultTableRowRenderer which imported from react-virtualized). So in this case, i should explicit pass it as a mapped arg in the story file?
any way, i removed the default prop and drilled it down like below