diff --git a/.changeset/mean-clubs-beam.md b/.changeset/mean-clubs-beam.md new file mode 100644 index 000000000..689a932cb --- /dev/null +++ b/.changeset/mean-clubs-beam.md @@ -0,0 +1,5 @@ +--- +"@rnx-kit/react-native-host": patch +--- + +Handle `useShadowNodeStateOnClone` being removed in 0.85 diff --git a/packages/react-native-host/cocoa/RNXFeatureMacros.h b/packages/react-native-host/cocoa/RNXFeatureMacros.h index a82b6e840..04c19723b 100644 --- a/packages/react-native-host/cocoa/RNXFeatureMacros.h +++ b/packages/react-native-host/cocoa/RNXFeatureMacros.h @@ -16,6 +16,15 @@ #if USE_BRIDGELESS +#if __has_include() +#include +#define REACT_NATIVE_VERSION \ + REACT_NATIVE_VERSION_MAJOR * 1000000 + REACT_NATIVE_VERSION_MINOR * 1000 + \ + REACT_NATIVE_VERSION_PATCH +#else +#define REACT_NATIVE_VERSION 0 +#endif // __has_include() + #if __has_include() #define USE_REACT_NATIVE_CONFIG 1 #endif // __has_include() @@ -38,7 +47,8 @@ #define USE_VIEW_COMMAND_RACE_FIX 1 #endif // !__has_include() -#if __has_include() || __has_include() +// `useShadowNodeStateOnClone` should be enabled from 0.79 and is on by default in 0.85 +#if REACT_NATIVE_VERSION < 85000 && (__has_include() || __has_include()) #define USE_UPDATE_RUNTIME_SHADOW_NODE_REFS_ON_COMMIT 1 #endif // __has_include()