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

Fix shallow renderer set instance state after gDSFP before calling sCU #14613

Merged
merged 6 commits into from Jan 18, 2019

Conversation

Projects
None yet
3 participants
@chenesan
Copy link
Contributor

chenesan commented Jan 17, 2019

This PR fixes #14607 which is related to airbnb/enzyme#1970 . Before this the shallow renderer will update instance state before shouldComponentUpdate if getDeriveStateFromProps return new partial state, make the passed nextState and old this.state the same in shouldComponentUpdate, which is different behavior with real rendering with ReactDOM.render (see the tests).

gaearon added some commits Jan 18, 2019

@gaearon

This comment has been minimized.

Copy link
Member

gaearon commented Jan 18, 2019

I think _updateStateFromStaticLifecycle might have been creating more confusion than what it's worth due to timing issues of what writes when. So I unwound it. I think this makes sense.

@gaearon
Copy link
Member

gaearon left a comment

I checked Enzyme tests and they pass. Seems good. Thanks.

@gaearon gaearon merged commit 4f33288 into facebook:master Jan 18, 2019

1 check passed

ci/circleci Your tests passed on CircleCI!
Details

jetoneza added a commit to jetoneza/react that referenced this pull request Jan 23, 2019

Fix shallow renderer set instance state after gDSFP before calling sCU (
facebook#14613)

* Fix shallow renderer set instance state after gDSFP before calling sCU

* Update ReactShallowRenderer.js

* Unwind abstraction

* Fewer names

n8schloss added a commit to n8schloss/react that referenced this pull request Jan 31, 2019

Fix shallow renderer set instance state after gDSFP before calling sCU (
facebook#14613)

* Fix shallow renderer set instance state after gDSFP before calling sCU

* Update ReactShallowRenderer.js

* Unwind abstraction

* Fewer names

Kiku-git added a commit to Kiku-git/react that referenced this pull request Feb 10, 2019

Fix shallow renderer set instance state after gDSFP before calling sCU (
facebook#14613)

* Fix shallow renderer set instance state after gDSFP before calling sCU

* Update ReactShallowRenderer.js

* Unwind abstraction

* Fewer names
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment