diff --git a/src/core/ReactUpdates.js b/src/core/ReactUpdates.js index fe4de4ffc2..6c2d4f675e 100644 --- a/src/core/ReactUpdates.js +++ b/src/core/ReactUpdates.js @@ -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 {