Skip to content

Commit 2c896d3

Browse files
sammy-SCfacebook-github-bot
authored andcommitted
Do not attach root view until size is available
Summary: Changelog: [internal] # Why is text laid out twice in Fabric? Layout constraints (min and max size) change during startup of Fabric surface. 1. `Scheduler::startSurface` is called with max size being {inf, inf}. 2. `Scheduler::constraintSurfaceLayout` is called with max size equal to viewport. These are two operations that don't happen one after the other and on Android, CompleteRoot is called from JS before second operation is called. This triggers layout with max size {inf, inf} and later when second operation is called. Layout happens again now with correct size. # Fix Make sure `Scheduler::startSurface` is called with proper values and not {inf, inf}. Reviewed By: JoshuaGross, yungsters Differential Revision: D23866735 fbshipit-source-id: b16307543cc75c689d0c1f0a16aa581458f7417d
1 parent e5006b3 commit 2c896d3

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

ReactAndroid/src/main/java/com/facebook/react/ReactRootView.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -382,8 +382,6 @@ public void startReactApplication(
382382

383383
mReactInstanceManager.createReactContextInBackground();
384384

385-
attachToReactInstanceManager();
386-
387385
} finally {
388386
Systrace.endSection(TRACE_TAG_REACT_JAVA_BRIDGE);
389387
}

0 commit comments

Comments
 (0)