mirror of
https://github.com/facebook/react.git
synced 2026-02-24 20:53:03 +00:00
Allow nested ReactUpdates
This commit is contained in:
committed by
Paul O’Shannessy
parent
1658feade8
commit
5676a486cf
@@ -29,11 +29,13 @@ var dirtyComponents = [];
|
||||
* friends are batched such that components aren't updated unnecessarily.
|
||||
*/
|
||||
function batchedUpdates(callback) {
|
||||
invariant(
|
||||
!isBatchingUpdates,
|
||||
'batchedUpates(...): Attempt to batch updates in a context where updates ' +
|
||||
'are already being batched.'
|
||||
);
|
||||
if (isBatchingUpdates) {
|
||||
// We're already executing in an environment where updates will be batched,
|
||||
// so this is a no-op.
|
||||
callback();
|
||||
return;
|
||||
}
|
||||
|
||||
isBatchingUpdates = true;
|
||||
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user