mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Don't PreAllocate virtual views
Summary: Virtual views that are flattened and don't "FormsView" on-screen should not be preallocated. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D28811419 fbshipit-source-id: 949dcbf4cf3791355c58af785603b35fa50f3f02
This commit is contained in:
committed by
Facebook GitHub Bot
parent
fc2153cc43
commit
8ca18f0b60
@@ -561,6 +561,9 @@ void Binding::installFabricUIManager(
|
||||
disablePreallocateViews_ = reactNativeConfig_->getBool(
|
||||
"react_fabric:disabled_view_preallocation_android");
|
||||
|
||||
disableVirtualNodePreallocation_ = reactNativeConfig_->getBool(
|
||||
"react_fabric:disable_virtual_node_preallocation");
|
||||
|
||||
auto toolbox = SchedulerToolbox{};
|
||||
toolbox.contextContainer = contextContainer;
|
||||
toolbox.componentRegistryFactory = componentsRegistry->buildRegistryFunction;
|
||||
@@ -1141,7 +1144,8 @@ void Binding::schedulerDidRequestPreliminaryViewAllocation(
|
||||
|
||||
bool isLayoutableShadowNode = shadowView.layoutMetrics != EmptyLayoutMetrics;
|
||||
|
||||
if (disableVirtualNodePreallocation_ && !isLayoutableShadowNode) {
|
||||
if (disableVirtualNodePreallocation_ &&
|
||||
!shadowView.traits.check(ShadowNodeTraits::Trait::FormsView)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user