IntersectionObserver: Only reset modern io, if it exists (#51510)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51510

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D75077634

fbshipit-source-id: d648a5e8c1de8efd44f4b1d2c44932bfebe0fbb3
This commit is contained in:
Ramanpreet Nara
2025-05-28 11:25:50 -07:00
committed by Facebook GitHub Bot
parent 1161fb4fcd
commit 14a115282b
@@ -92,7 +92,10 @@ let modernNativeIntersectionObserver =
unobserve: NativeIntersectionObserver.unobserveV2,
};
if (!ReactNativeFeatureFlags.utilizeTokensInIntersectionObserver()) {
if (
modernNativeIntersectionObserver &&
!ReactNativeFeatureFlags.utilizeTokensInIntersectionObserver()
) {
modernNativeIntersectionObserver = null;
}