Hook up CPP props parsing and Android ViewRecycling feature flags on Android

Summary:
Hook up feature flags.

Changelog: [Internal]

Reviewed By: cortinico, ryancat

Differential Revision: D37166366

fbshipit-source-id: 440acba9ee85a9ced64cd880d915044de7619584
This commit is contained in:
Joshua Gross
2022-06-15 23:37:34 -07:00
committed by Facebook GitHub Bot
parent 63ddfa02ee
commit 577582e230
2 changed files with 15 additions and 0 deletions
@@ -130,4 +130,9 @@ public class ReactFeatureFlags {
* Feature Flag to enable View Recycling. When enabled, individual ViewManagers must still opt-in.
*/
public static boolean enableViewRecycling = false;
/**
* Enable prop iterator setter-style construction of Props in C++ (this flag is not used in Java).
*/
public static boolean enableCppPropsIteratorSetter = false;
}
@@ -32,6 +32,9 @@
#include <react/renderer/uimanager/primitives.h>
#include <react/utils/ContextContainer.h>
// Included to set BaseTextProps config; can be deleted later.
#include <react/renderer/components/text/BaseTextProps.h>
#include <glog/logging.h>
using namespace facebook::jni;
@@ -441,6 +444,13 @@ void Binding::installFabricUIManager(
"EnableLargeTextMeasureCache",
getFeatureFlagValue("enableLargeTextMeasureCache"));
// Props setter pattern feature
Props::enablePropIteratorSetter =
getFeatureFlagValue("enableCppPropsIteratorSetter");
AccessibilityProps::enablePropIteratorSetter =
Props::enablePropIteratorSetter;
BaseTextProps::enablePropIteratorSetter = Props::enablePropIteratorSetter;
auto toolbox = SchedulerToolbox{};
toolbox.contextContainer = contextContainer;
toolbox.componentRegistryFactory = componentsRegistry->buildRegistryFunction;