-
-
Notifications
You must be signed in to change notification settings - Fork 9.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@storybook/[email protected] Error on PropTypes.oneOfType when argument is a var #5206
Comments
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! |
I appreciate it’s a low priority issue. I’ll see if I can get a PR raised to resolve. Thanks. |
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! |
Thanks @johnhunter and sorry for the slow response. Everybody's been head's down on the SB5 release. Will def appreciate a fix if you have one. I'll also be prioritizing |
Thanks @shilman much appreciated - i'm looking forward to seeing SB5. Not able to get to a fix at the moment, will let you know if I do. |
Upgrade to 5.0.1 resolved this issue. With the given example Great work on SB5 - thanks! |
Describe the bug
Addon-info throws an exception (when a story is rendered) if a mounted component defines a
PropTypes.oneOfType
as a variable rather than an array literal.To Reproduce
Steps to reproduce the behavior:
Expected behavior
The component renders without error
Actual behavior
The exception occurs at:
https://github.com/storybooks/storybook/blob/4c757d05f162925217751bb5d61518c108d0935b/addons/info/src/components/types/OneOfType.js#L10-L11
where
propTypes
is expected to be an iterable (either an array of propType, or an object of name "custom"). In this case the value is the string name of the variable passed toPropTypes.oneOfType
in the Component - in this case "b".Code snippets
Test.jsx
System:
Additional context
It is valid and desirable to use variables as arguments to oneOfType. Its likely that the problem is with react-dom passing the
propTypes
as a string. However the plugin should guard against the exception and at a minimum report the propType as "custom" or "unknown".The text was updated successfully, but these errors were encountered: