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

Event handlers from different component trees should batch together #1227

Closed
sophiebits opened this issue Mar 7, 2014 · 2 comments · Fixed by #1231
Closed

Event handlers from different component trees should batch together #1227

sophiebits opened this issue Mar 7, 2014 · 2 comments · Fixed by #1231

Comments

@sophiebits
Copy link
Collaborator

Right now, ReactUpdates.batchedUpdates is called in ReactEventEmitterMixin.js but should probably be higher up in ReactTopLevelEventCallback.js so that with nested roots, updates are queued into the same batch.

@syranide
Copy link
Contributor

syranide commented Mar 7, 2014

Side-note, I'm not 100% up on the details of state and DOM batching. But it seems like RAF-batching is something they intend to make default "soon in the future", which would take care of batching both state and DOM updates I believe? Again, in the future.

@sophiebits
Copy link
Collaborator Author

Yeah, we're going to do that once we figure out how pending state works. I believe we still want to flush any updates within the same event loop though, so this change will still be helpful.

sophiebits added a commit to sophiebits/react that referenced this issue Apr 4, 2014
Fixes facebook#1227.

It seems rare that event handlers in two roots nested in the DOM will update the same component in the same tick, but if that happens, the updates should be batched together.
zpao added a commit that referenced this issue Apr 12, 2014
Batch updates caused by handlers in multiple roots
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 a pull request may close this issue.

2 participants