Closed shmidt-i closed 3 years ago
Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks!
@andezzat here's the forwardRef
case as we discussed relative to #12638
Jeepers creepers!! I just released https://github.com/storybookjs/storybook/releases/tag/v6.1.0-alpha.21 containing PR #12686 that references this issue. Upgrade today to try it out!
You can find this prerelease on the @next
NPM tag.
Describe the bug ForwardRef components receive
undefined
asprops
duringexractProps
step. https://github.com/storybookjs/storybook/blob/next/addons/docs/src/frameworks/react/extractProps.ts#L28-L31Check out code snippets [1], [2]
Both are actually incorrect, since in React runtime you always have the
props
object presented, it just doesn't have any keys on it if no props were passed.To Reproduce If you change
examples/official-storybook/components/ForwardedRefButton.js
to have a destructuring on props, the props extraction process will fail, e.g. [3]And then check the story examples/official-storybook/stories/addon-docs/props.stories.mdx. There would be no props available for the component.
Expected behavior Props table is shown
Code snippets [1]:
[2]:
[3]:
System: Replicated in latest storybook repo's examples, but originally found in @storybook/addon-docs@5.2.5.
Additional context Here is a downgrade commit in our repo that fixed the behaviour: https://github.com/nordnet/ui/commit/6cf7ee5a56d1b065aba1243a30baa267805e8b13.
The component that failed was https://github.com/nordnet/ui/tree/master/src/Atoms/Box