diff --git a/android/build.gradle b/android/build.gradle index aac382529c3..3de90e57872 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -377,6 +377,15 @@ android { } else { srcDirs += "src/reactNativeVersionPatch/ReanimatedUIManager/latest" } + + // ReactFeatureFlags + if (IS_NEW_ARCHITECTURE_ENABLED) { + if (REACT_NATIVE_MINOR_VERSION <= 72) { + srcDirs += "src/reactNativeVersionPatch/ReactFeatureFlagsWrapper/72" + } else { + srcDirs += "src/reactNativeVersionPatch/ReactFeatureFlagsWrapper/latest" + } + } } } } diff --git a/android/src/fabric/java/com/swmansion/reanimated/NativeProxy.java b/android/src/fabric/java/com/swmansion/reanimated/NativeProxy.java index 1918820e002..da7d6110657 100644 --- a/android/src/fabric/java/com/swmansion/reanimated/NativeProxy.java +++ b/android/src/fabric/java/com/swmansion/reanimated/NativeProxy.java @@ -1,7 +1,5 @@ package com.swmansion.reanimated; -import android.util.Log; - import com.facebook.jni.HybridData; import com.facebook.proguard.annotations.DoNotStrip; import com.facebook.react.bridge.ReactApplicationContext; @@ -10,12 +8,10 @@ import com.facebook.react.turbomodule.core.CallInvokerHolderImpl; import com.facebook.react.uimanager.UIManagerHelper; import com.facebook.react.uimanager.common.UIManagerType; -import com.swmansion.reanimated.layoutReanimation.AnimationsManager; import com.swmansion.reanimated.layoutReanimation.LayoutAnimations; import com.swmansion.reanimated.layoutReanimation.NativeMethodsHolder; import com.swmansion.reanimated.nativeProxy.NativeProxyCommon; -import java.lang.ref.WeakReference; import java.util.HashMap; public class NativeProxy extends NativeProxyCommon { @@ -25,7 +21,7 @@ public class NativeProxy extends NativeProxyCommon { public NativeProxy(ReactApplicationContext context) { super(context); - + ReactFeatureFlagsWrapper.enableMountHooks(); CallInvokerHolderImpl holder = (CallInvokerHolderImpl) context.getCatalystInstance().getJSCallInvokerHolder(); diff --git a/android/src/reactNativeVersionPatch/ReactFeatureFlagsWrapper/72/com/swmansion/reanimated/ReactFeatureFlagsWrapper.java b/android/src/reactNativeVersionPatch/ReactFeatureFlagsWrapper/72/com/swmansion/reanimated/ReactFeatureFlagsWrapper.java new file mode 100644 index 00000000000..e0630f7f2dc --- /dev/null +++ b/android/src/reactNativeVersionPatch/ReactFeatureFlagsWrapper/72/com/swmansion/reanimated/ReactFeatureFlagsWrapper.java @@ -0,0 +1,9 @@ +package com.swmansion.reanimated; + +public class ReactFeatureFlagsWrapper { + + public static void enableMountHooks() { + // no-op + } + +} diff --git a/android/src/reactNativeVersionPatch/ReactFeatureFlagsWrapper/latest/com/swmansion/reanimated/ReactFeatureFlagsWrapper.java b/android/src/reactNativeVersionPatch/ReactFeatureFlagsWrapper/latest/com/swmansion/reanimated/ReactFeatureFlagsWrapper.java new file mode 100644 index 00000000000..a6a2c1690be --- /dev/null +++ b/android/src/reactNativeVersionPatch/ReactFeatureFlagsWrapper/latest/com/swmansion/reanimated/ReactFeatureFlagsWrapper.java @@ -0,0 +1,11 @@ +package com.swmansion.reanimated; + +import com.facebook.react.config.ReactFeatureFlags; + +public class ReactFeatureFlagsWrapper { + + public static void enableMountHooks() { + ReactFeatureFlags.enableMountHooks = true; + } + +}