diff --git a/Libraries/BatchedBridge/MessageQueue.js b/Libraries/BatchedBridge/MessageQueue.js index 80c27443b..ac4c2a2bc 100644 --- a/Libraries/BatchedBridge/MessageQueue.js +++ b/Libraries/BatchedBridge/MessageQueue.js @@ -182,10 +182,11 @@ class MessageQueue { const now = new Date().getTime(); if (global.nativeFlushQueueImmediate && (now - this._lastFlush >= MIN_TIME_BETWEEN_FLUSHES_MS || - this._inCall === 0)) { - global.nativeFlushQueueImmediate(this._queue); + this._inCall === 0)) { + var queue = this._queue; this._queue = [[], [], [], this._callID]; this._lastFlush = now; + global.nativeFlushQueueImmediate(queue); } Systrace.counterEvent('pending_js_to_native_queue', this._queue[0].length); if (__DEV__ && this.__spy && isFinite(moduleID)) { diff --git a/ReactAndroid/src/main/java/com/facebook/react/cxxbridge/BUCK b/ReactAndroid/src/main/java/com/facebook/react/cxxbridge/BUCK index 2016d67ea..42c40aa1e 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/cxxbridge/BUCK +++ b/ReactAndroid/src/main/java/com/facebook/react/cxxbridge/BUCK @@ -6,6 +6,7 @@ android_library( exported_deps = [ react_native_dep("java/com/facebook/jni:jni"), react_native_dep("java/com/facebook/proguard/annotations:annotations"), + react_native_target("java/com/facebook/react/bridge:bridge"), ], proguard_config = "bridge.pro", visibility = [ @@ -26,7 +27,6 @@ android_library( # '//native/react/jni:jni-internal', react_native_dep("third-party/java/infer-annotations:infer-annotations"), react_native_dep("third-party/java/jsr-305:jsr-305"), - react_native_target("java/com/facebook/react/bridge:bridge"), react_native_target("java/com/facebook/react/common:common"), react_native_target("java/com/facebook/react/devsupport:devsupport"), react_native_target("java/com/facebook/react/module/model:model"),