Skip to content

Batch subupdates caused by any state update#1363

Merged
zpao merged 2 commits intofacebook:masterfrom
sophiebits:batch-all
May 22, 2014
Merged

Batch subupdates caused by any state update#1363
zpao merged 2 commits intofacebook:masterfrom
sophiebits:batch-all

Conversation

@sophiebits
Copy link
Collaborator

With this, multiple setState calls triggered by a componentDidUpdate handler (or similar) will be batched together, regardless of if the original setState call was in a batching context.

I also cleaned up some inconsistencies with the order of component updates and callbacks in situations where one component's update directly causes another to update.

Fixes #1147 and #983. Helps with #1353 and #1245 as well, though doesn't completely fix them yet.

Test Plan:
grunt test

Depends on #1362 and #1358.

Copy link
Contributor

Choose a reason for hiding this comment

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

Could use single quotes and %s here for consistency?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks, fixed.

With this, multiple setState calls triggered by a componentDidUpdate handler (or similar) will be batched together, regardless of if the original setState call was in a batching context.

I also cleaned up some inconsistencies with the order of component updates and callbacks in situations where one component's update directly causes another to update.

Fixes facebook#1147. Helps with facebook#1353 and facebook#1245 as well, though doesn't completely fix them yet.

Test Plan:
grunt test
@facebook-github-bot
Copy link
Contributor

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

zpao added a commit that referenced this pull request May 22, 2014
Batch subupdates caused by any state update
@zpao zpao merged commit f9ad17d into facebook:master May 22, 2014
sophiebits added a commit to sophiebits/react-art that referenced this pull request May 29, 2014
sophiebits added a commit to sophiebits/react-art that referenced this pull request May 29, 2014
superbuddyy added a commit to superbuddyy/react-art-world that referenced this pull request Aug 9, 2022
Oleksandr0305 added a commit to Oleksandr0305/react-art that referenced this pull request Jan 31, 2025
othellodev added a commit to othellodev/react-art that referenced this pull request Aug 29, 2025
chrisgadev added a commit to chrisgadev/react-art that referenced this pull request Aug 29, 2025
AlexisMartz added a commit to AlexisMartz/toawes that referenced this pull request Sep 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Obscure DOMChildrenOperations error when doing multiple updates

4 participants