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

Fix ReactShallowRenderer not rerendering when calling forceUpdate() #11439

Merged
merged 2 commits into from Nov 3, 2017

Conversation

d4rky-pl
Copy link
Contributor

@d4rky-pl d4rky-pl commented Nov 3, 2017

This is a followup to #11239. Unfortunately the fix implemented for #11236 was incorrect and it didn't solve the underlying issue of not rerendering component properly on forceUpdate.

This PR solves the issue and adds necessary test to make sure it's resolved properly this time.

if (typeof this._instance.shouldComponentUpdate === 'function') {
if (
typeof this._instance.shouldComponentUpdate === 'function' &&
this._forcedUpdate !== true
Copy link
Collaborator

Choose a reason for hiding this comment

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

This can just be !this._forcedUpdate, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, _forcedUpdate is always a boolean

@gaearon gaearon merged commit 779d23f into facebook:master Nov 3, 2017
Ethan-Arrowood pushed a commit to Ethan-Arrowood/react that referenced this pull request Dec 8, 2017
…acebook#11439)

* Fix ReactShallowRenderer not rerendering when calling forceUpdate()

* Style nit
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.

None yet

3 participants