Skip to content

Batch subupdates caused by any state update #1363

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

Merged
merged 2 commits into from
May 22, 2014
Merged

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.

len === dirtyComponents.length,
"Expected flush transaction's stored dirty-components " +
"length (" + len + ") to match dirty-components array " +
"length (" + dirtyComponents.length + ")."
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
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