RCTSurface: Optional sync ShadowView/View registing

Summary:
See the comment in code.
If we on the main thread on registering time, we can/will break sequentiality of registering and mounting processes doing registration asynchronously.
We need this to make sync mouting eventually possible.

Reviewed By: fkgozali

Differential Revision: D7014176

fbshipit-source-id: 110ad5e5d86e3422eac15c3b1bdb29ae04acd7e6
This commit is contained in:
Valentin Shergin 2018-02-20 22:11:51 -08:00 committed by Facebook Github Bot
parent 8c036ce090
commit b90c1cf6c3
1 changed files with 3 additions and 1 deletions

View File

@ -321,7 +321,9 @@
RCTUIManager *uiManager = batchedBridge.uiManager; RCTUIManager *uiManager = batchedBridge.uiManager;
RCTExecuteOnUIManagerQueue(^{ // If we are on the main queue now, we have to proceed synchronously.
// Otherwise, we cannot perform synchronous waiting for some stages later.
(RCTIsMainQueue() ? RCTUnsafeExecuteOnUIManagerQueueSync : RCTExecuteOnUIManagerQueue)(^{
[uiManager registerRootViewTag:self->_rootViewTag]; [uiManager registerRootViewTag:self->_rootViewTag];
RCTSurfaceRootShadowView *rootShadowView = RCTSurfaceRootShadowView *rootShadowView =