From 0491142702f5d7b0aa60446463752fdde73f0980 Mon Sep 17 00:00:00 2001 From: Justin Spahr-Summers Date: Tue, 17 Nov 2015 10:19:48 -0800 Subject: [PATCH] Invoke -reactBridgeDidFinishTransaction per-batch, not per-flush Reviewed By: tadeuzagallo, majak Differential Revision: D2663382 fb-gh-sync-id: f3bd77e0ec8fd4129657fc1c23cc542cf7f0c223 --- React/Modules/RCTUIManager.m | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/React/Modules/RCTUIManager.m b/React/Modules/RCTUIManager.m index fcc27d9e9..83ced744d 100644 --- a/React/Modules/RCTUIManager.m +++ b/React/Modules/RCTUIManager.m @@ -904,6 +904,15 @@ RCT_EXPORT_METHOD(findSubviewIn:(nonnull NSNumber *)reactTag atPoint:(CGPoint)po _nextLayoutAnimation = nil; } + [self addUIBlock:^(RCTUIManager *uiManager, __unused NSDictionary *viewRegistry) { + /** + * TODO(tadeu): Remove it once and for all + */ + for (id node in uiManager->_bridgeTransactionListeners) { + [node reactBridgeDidFinishTransaction]; + } + }]; + [self flushUIBlocks]; } @@ -927,12 +936,6 @@ RCT_EXPORT_METHOD(findSubviewIn:(nonnull NSNumber *)reactTag atPoint:(CGPoint)po for (dispatch_block_t block in previousPendingUIBlocks) { block(); } - /** - * TODO(tadeu): Remove it once and for all - */ - for (id node in _bridgeTransactionListeners) { - [node reactBridgeDidFinishTransaction]; - } } @catch (NSException *exception) { RCTLogError(@"Exception thrown while executing UI block: %@", exception);