-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Handle unknown proptypes #91
Handle unknown proptypes #91
Conversation
LGTM. I like the idea of displaying @sapegin: Merge? |
@mik01aj Good call. I was meant to go back and fix those up and completely forgot 👍 |
@@ -11,6 +11,8 @@ export let Code = ({ className = '', children }) => { | |||
return <code className={sMarkdown.code + ' ' + className}>{children}</code>; | |||
}; | |||
|
|||
export let UnknownPropType = () => <span>unknown</span>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to export it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is actually no longer required, have removed this now.
Just two comments from me, otherwise I really like this. Thanks @karlbright! |
All sorted. |
Fixes #77.
This ensures that any prop that is assigned via
getDefaultProps
but missing frompropTypes
will be shown as an unknown prop type.Although this is bad practice in React, I think it's probably best to display the style guide rather than throw and error for this, and ensure that the user can find out the explanation behind unknown proptypes in the styleguide readme.