@samitouri / QOS-React-2 / commits / 5676a486cf
Fork 0

The library for web and native user interfaces.

Allow nested ReactUpdates

Pete Hunt committed Jul 8, 2013 at 11:41 UTC 5676a486cf2e79e7ca559fc53cabdb4e12f3f4bb
1 file changed +7 -5
src/core/ReactUpdates.js
+7 -5
@@ -29,11 +29,13 @@ var dirtyComponents = [];
29 * friends are batched such that components aren't updated unnecessarily.
30 */
31 function batchedUpdates(callback) {
32 - invariant(
33 - !isBatchingUpdates,
34 - 'batchedUpates(...): Attempt to batch updates in a context where updates ' +
35 - 'are already being batched.'
36 - );
32 + if (isBatchingUpdates) {
33 + // We're already executing in an environment where updates will be batched,
34 + // so this is a no-op.
35 + callback();
36 + return;
37 + }
38 +
39 isBatchingUpdates = true;
40
41 try {