Skip to content

Commit

Permalink
Hook up CPP props parsing and Android ViewRecycling feature flags on …
Browse files Browse the repository at this point in the history
…Android

Summary:
Hook up feature flags.

Changelog: [Internal]

Reviewed By: cortinico, ryancat

Differential Revision: D37166366

fbshipit-source-id: 440acba9ee85a9ced64cd880d915044de7619584
  • Loading branch information
JoshuaGross authored and facebook-github-bot committed Jun 16, 2022
1 parent 63ddfa0 commit 577582e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 577582e

Please sign in to comment.