-
-
Notifications
You must be signed in to change notification settings - Fork 32.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
[docs] Add @eps1lon to the team page #13768
Conversation
@@ -111,7 +111,7 @@ StepContent.propTypes = { | |||
/** | |||
* Collapse component. | |||
*/ | |||
TransitionComponent: PropTypes.func, | |||
TransitionComponent: PropTypes.oneOfType([PropTypes.string, PropTypes.func, PropTypes.object]), |
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.
Bonus, I have spotted the inconsistency with a forwardRef warning.
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.
Funny thing. I always assumed a component is a function or an object because in my mind components can be classes. But only the instances are objects. The actual newable thing is still a function. So I don't know if either someone made the same mistake as I did or actually already thought about forwardRef
and memo
.
I locally experimented with react-is
and want to follow up on this with an actual component validator that uses isValidElementType
to improve the docs and dev warnings e.g. if one uses default imports when the module only has named exports. Then PropTypes.object
would let it pass but react would later warn on createElement
.
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.
Using react-is
is definitely an interesting path to improve the component prop-type 👍 .
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.
Yes, I believe somebody was facing the forwardRef
issue some time ago.
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.
❤️
No description provided.