-
Notifications
You must be signed in to change notification settings - Fork 47k
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
Remove prop types checking in ReactCompositeComponent #6824
Conversation
@@ -830,7 +794,7 @@ var ReactCompositeComponentMixin = { | |||
// warning for DOM component props in this upgrade | |||
nextProps = nextParentElement.props; | |||
} else { | |||
nextProps = this._processProps(nextParentElement.props); | |||
nextProps = nextParentElement.props; | |||
willReceive = true; | |||
} |
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.
Can you simplify this to
nextProps = nextParentElement.props;
if (prevParentElement !== nextParentElement) {
willReceive = true;
}
now?
false, | ||
'Failed Context Types: %s%s', | ||
error.message, | ||
addendum |
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 you mind switching this to use getStackAddendumByID to show the stack? That can be a separate PR if you prefer.
It's not obvious to me whether the two methods can be easily combined because they behave a little differently with the addendum (and it would be nice to calculate the addendum only if there is a warning) but if you see a way to clean them up let's do that in a follow-up PR. |
After fixing the inline comments, feel free to merge. |
@keyanzhang updated the pull request. |
Remove prop types checking in ReactCompositeComponent (cherry picked from commit c136369)
Remove prop types checking in ReactCompositeComponent (cherry picked from commit c136369)
Implements #6791. I renamed
_checkPropTypes()
to_checkContextTypes()
since it only checks context types for now.Moreover, now
ReactElementValidator
'scheckPropTypes()
andReactCompositeComponent
's_checkContextTypes()
are pretty much the same and we can merge them. Should I create a separate PR to refactor them or just change them here? @spicyj