Allow nested ReactUpdates

This commit is contained in:
Pete Hunt 2013-07-08 11:41:19 -07:00 committed by Paul O’Shannessy
parent 1658feade8
commit 5676a486cf
1 changed files with 7 additions and 5 deletions

View File

@ -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 {