mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Remove allowDisablingImmediateExecutionOfScheduleMountItems feature flag
Summary: No longer needed. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D20747684 fbshipit-source-id: a8077519b7670d72e23267b1c1423556ec97be3f
This commit is contained in:
committed by
Facebook GitHub Bot
parent
f21f922c83
commit
b8664182da
@@ -127,11 +127,9 @@ public class ReactRootView extends FrameLayout implements RootView, ReactRoot {
|
||||
@Override
|
||||
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
|
||||
// TODO: T60453649 - Add test automation to verify behavior of onMeasure
|
||||
setAllowImmediateUIOperationExecution(false);
|
||||
|
||||
if (mUseSurface) {
|
||||
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
|
||||
setAllowImmediateUIOperationExecution(true);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -185,7 +183,6 @@ public class ReactRootView extends FrameLayout implements RootView, ReactRoot {
|
||||
mLastHeight = height;
|
||||
|
||||
} finally {
|
||||
setAllowImmediateUIOperationExecution(true);
|
||||
Systrace.endSection(TRACE_TAG_REACT_JAVA_BRIDGE);
|
||||
}
|
||||
}
|
||||
@@ -443,43 +440,6 @@ public class ReactRootView extends FrameLayout implements RootView, ReactRoot {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* In Fabric, it is possible for MountItems to be scheduled during onMeasure calls, specifically:
|
||||
*
|
||||
* <p>ReactRootView.onMeasure -> ReactRootView.updateRootLayoutSpecs ->
|
||||
* FabricUIManager.updateRootLayoutSpecs -> Binding.setConstraints -> (C++) commit new tree ->
|
||||
* (C++ Android binding) diff tree, schedule mount items -> FabricUIManager.scheduleMountItem
|
||||
*
|
||||
* <p>If called on the main thread, `scheduleMountItem` will execute MountItems synchronously,
|
||||
* causing all ShadowNode updates to be flushed to the view hierarchy, on the main thread, during
|
||||
* an onMeasure call.
|
||||
*
|
||||
* <p>Use this method to disable immediate execution of mount items.
|
||||
*
|
||||
* <p>This is a noop outside in pre-Fabric React Native.
|
||||
*/
|
||||
private void setAllowImmediateUIOperationExecution(boolean flag) {
|
||||
final ReactInstanceManager reactInstanceManager = mReactInstanceManager;
|
||||
|
||||
if (reactInstanceManager == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
final ReactContext reactApplicationContext = reactInstanceManager.getCurrentReactContext();
|
||||
|
||||
if (reactApplicationContext == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
UIManager uiManager = UIManagerHelper.getUIManager(reactApplicationContext, getUIManagerType());
|
||||
// Ignore calling setAllowImmediateUIOperationExecution if UIManager is not properly
|
||||
// initialized.
|
||||
if (uiManager != null) {
|
||||
uiManager.setAllowImmediateUIOperationExecution(flag);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Unmount the react application at this root view, reclaiming any JS memory associated with that
|
||||
* application. If {@link #startReactApplication} is called, this method must be called before the
|
||||
|
||||
Reference in New Issue
Block a user