Storybook: Unable to display nested components props correctly

Created on 3 Jul 2020  路  5Comments  路  Source: storybookjs/storybook

I might be mis-using the functionnality, in case apologies; but I havent't found any relevant clues if this use case had to be handled differently

Feature request related to a problem?*
Re-using nested components props to validate on parent component as follow :

Component.propTypes = {
  header: PropTypes.shape(CardHeader.propTypes),
  ...
};

But getting weird displays :
Capture d鈥檈虂cran 2020-07-03 a虁 11 14 20

Using the following syntax :

Component.propTypes = {
  header: PropTypes.shape({ ...CardHeader.propTypes })
};

Getting the following display (empty hash) :

Capture d鈥檈虂cran 2020-07-03 a虁 12 32 28

Describe the solution you'd like
Getting the same output as a manual shape use would provide

Alternatives considered
None yet

Able to bring the feature to reality?
no, unsure

props question / support todo

All 5 comments

sorry to ask again; is this case to be handled with a different pattern; or is it just a limitation at the moment ?

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!

If someone could provide help; just to know if our expectation is something that should not be considered; and what would be the workaround

Sorry I haven't had a chance to dig into this. But if you're on 6.0 you can manually override the ArgsTable values if the automated stuff is not doing what you need: https://github.com/storybookjs/storybook/blob/next/addons/controls/README.md#my-controls-arent-being-auto-generated-what-should-i-do

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!

Was this page helpful?
0 / 5 - 0 ratings