diff --git a/Libraries/Utilities/MessageQueue.js b/Libraries/Utilities/MessageQueue.js index 589ee5e9a..660d09876 100644 --- a/Libraries/Utilities/MessageQueue.js +++ b/Libraries/Utilities/MessageQueue.js @@ -76,15 +76,17 @@ class MessageQueue { * Public APIs */ processBatch(batch) { - ReactUpdates.batchedUpdates(() => { - batch.forEach((call) => { - let method = call.method === 'callFunctionReturnFlushedQueue' ? - '__callFunction' : '__invokeCallback'; - guard(() => this[method].apply(this, call.args)); + guard(() => { + ReactUpdates.batchedUpdates(() => { + batch.forEach((call) => { + let method = call.method === 'callFunctionReturnFlushedQueue' ? + '__callFunction' : '__invokeCallback'; + guard(() => this[method].apply(this, call.args)); + }); + BridgeProfiling.profile('ReactUpdates.batchedUpdates()'); }); - BridgeProfiling.profile('ReactUpdates.batchedUpdates()'); + BridgeProfiling.profileEnd(); }); - BridgeProfiling.profileEnd(); return this.flushedQueue(); }