Skip to content

Remove prop types checking in ReactCompositeComponent - #6824

Merged
keyz merged 2 commits into
react:masterfrom
keyz:hey-prop-types-just-once
May 23, 2016
Merged

Remove prop types checking in ReactCompositeComponent#6824
keyz merged 2 commits into
react:masterfrom
keyz:hey-prop-types-just-once

Conversation

@keyz

@keyz keyz commented May 21, 2016

Copy link
Copy Markdown
Contributor

Implements #6791. I renamed _checkPropTypes() to _checkContextTypes() since it only checks context types for now.
Moreover, now ReactElementValidator's checkPropTypes() and ReactCompositeComponent'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

nextProps = this._processProps(nextParentElement.props);
nextProps = nextParentElement.props;
willReceive = true;
}

Copy link
Copy Markdown
Contributor

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?

@sophiebits sophiebits added this to the 15.y.z milestone May 23, 2016
false,
'Failed Context Types: %s%s',
error.message,
addendum

Copy link
Copy Markdown
Contributor

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.

@sophiebits

Copy link
Copy Markdown
Contributor

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.

@sophiebits

Copy link
Copy Markdown
Contributor

After fixing the inline comments, feel free to merge.

@ghost

ghost commented May 23, 2016

Copy link
Copy Markdown

@keyanzhang updated the pull request.

@keyz
keyz merged commit c136369 into react:master May 23, 2016
@keyz
keyz deleted the hey-prop-types-just-once branch May 23, 2016 18:13
zpao pushed a commit to zpao/react that referenced this pull request Jun 8, 2016
Remove prop types checking in ReactCompositeComponent

(cherry picked from commit c136369)
zpao pushed a commit that referenced this pull request Jun 14, 2016
Remove prop types checking in ReactCompositeComponent

(cherry picked from commit c136369)
@zpao zpao modified the milestones: 15-next, 15.2.0 Jun 14, 2016
mrizwanashiq pushed a commit to mrizwanashiq/react that referenced this pull request Jun 25, 2026
Remove prop types checking in ReactCompositeComponent
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants