mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Force updateRootLayoutSpecs to run synchronously
Summary: This diff makes updateRootLayoutSpecs to run synchronously on any thread instead of schedulling this to run in the JS thread Reviewed By: shergin Differential Revision: D14142306 fbshipit-source-id: 746f9c51f13e6d987fd9bca35a7c502cc8622f7b
This commit is contained in:
committed by
Facebook Github Bot
parent
eae89d829f
commit
1aa279d78b
@@ -23,7 +23,6 @@ import com.facebook.common.logging.FLog;
|
||||
import com.facebook.infer.annotation.Assertions;
|
||||
import com.facebook.infer.annotation.ThreadConfined;
|
||||
import com.facebook.proguard.annotations.DoNotStrip;
|
||||
import com.facebook.react.bridge.GuardedRunnable;
|
||||
import com.facebook.react.bridge.LifecycleEventListener;
|
||||
import com.facebook.react.bridge.NativeMap;
|
||||
import com.facebook.react.bridge.ReactApplicationContext;
|
||||
@@ -364,21 +363,13 @@ public class FabricUIManager implements UIManager, LifecycleEventListener {
|
||||
public void updateRootLayoutSpecs(
|
||||
final int rootTag, final int widthMeasureSpec, final int heightMeasureSpec) {
|
||||
|
||||
// TODO T31905686: this should not run in a different thread.
|
||||
// This is a workaround because a race condition that happens in core of RN.
|
||||
// We are analyzing this and fixing it as part of another diff.
|
||||
mReactApplicationContext.runOnJSQueueThread(
|
||||
new GuardedRunnable(mReactApplicationContext) {
|
||||
@Override
|
||||
public void runGuarded() {
|
||||
mBinding.setConstraints(
|
||||
rootTag,
|
||||
getMinSize(widthMeasureSpec),
|
||||
getMaxSize(widthMeasureSpec),
|
||||
getMinSize(heightMeasureSpec),
|
||||
getMaxSize(heightMeasureSpec));
|
||||
}
|
||||
});
|
||||
mBinding.setConstraints(
|
||||
rootTag,
|
||||
getMinSize(widthMeasureSpec),
|
||||
getMaxSize(widthMeasureSpec),
|
||||
getMinSize(heightMeasureSpec),
|
||||
getMaxSize(heightMeasureSpec));
|
||||
|
||||
}
|
||||
|
||||
public void receiveEvent(int reactTag, String eventName, @Nullable WritableMap params) {
|
||||
|
||||
Reference in New Issue
Block a user