Permalink
Browse files

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
  • Loading branch information...
shergin authored and facebook-github-bot committed Feb 21, 2018
1 parent 8c036ce commit b90c1cf6c30454859579278be18ac650c66f516b
Showing with 3 additions and 1 deletion.
  1. +3 −1 React/Base/Surface/RCTSurface.mm
@@ -321,7 +321,9 @@ - (void)_registerRootView
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];
RCTSurfaceRootShadowView *rootShadowView =

0 comments on commit b90c1cf

Please sign in to comment.