Skip to content
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

Shallow renderer passes context to componentWillReceiveProps #10342

Conversation

bvaughn
Copy link
Contributor

@bvaughn bvaughn commented Aug 1, 2017

In a recent conversation between @lelandrichardson, @flarnie, and myself, @lelandrichardson pointed out that the new React 16 shallow renderer did not pass the 2nd param, context, to componentWillReceiveProps.

This was an oversight that has been corrected with this PR. I also added a new test to ensure that the new shallow renderer passes the expected params (and only those params) to each lifecycle method.

This parameter was accidentally omitted before. Leland reported it because it impacts Enzyme.
I also added a basic lifecycle parameter test for shallow renderer.
@bvaughn bvaughn force-pushed the shallow-renderer-componentWillReceiveProps-context-param branch from 0033663 to 0a0dd56 Compare August 1, 2017 23:31
Copy link
Contributor

@flarnie flarnie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sweet!

@flarnie
Copy link
Contributor

flarnie commented Aug 2, 2017

thumb-awesomekitty

@bvaughn bvaughn mentioned this pull request Aug 2, 2017
@bvaughn bvaughn merged commit 2da37a8 into facebook:master Aug 2, 2017
@bvaughn bvaughn deleted the shallow-renderer-componentWillReceiveProps-context-param branch August 2, 2017 15:19
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.

4 participants