question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to display nested components props correctly

See original GitHub issue

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 à 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 à 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

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:2
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
shilmancommented, Aug 9, 2020

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

1reaction
stale[bot]commented, Jul 27, 2020

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!

Read more comments on GitHub >

github_iconTop Results From Across the Web

unable to set prop on nested component - Stack Overflow
In this case, it most likely means you are trying to access selectedSectionId before this.props.item is initialized. How are the props passed ...
Read more >
React: Nested Components and Props - [007] - YouTube
In this episode we show you how to nest a component inside a component. We also show you the power of props. These...
Read more >
Troubleshooting | React Navigation
I'm getting an error "Unable to resolve module" after updating to the latest version​ ... The component prop expects a React Component, but...
Read more >
Guide to components in Figma
Users with can view access to the original file can use components from that Library. Video tutorials. Check out these video tutorials about...
Read more >
Hooks FAQ - React
Do Hooks replace render props and higher-order components? ... remove classes from React — we all need to keep shipping products and can't...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found