diff --git a/packages/react-native/Libraries/IntersectionObserver/__mocks__/NativeIntersectionObserver.js b/packages/react-native/Libraries/IntersectionObserver/__mocks__/NativeIntersectionObserver.js index 7bd88d6e1a9..e66a5e12159 100644 --- a/packages/react-native/Libraries/IntersectionObserver/__mocks__/NativeIntersectionObserver.js +++ b/packages/react-native/Libraries/IntersectionObserver/__mocks__/NativeIntersectionObserver.js @@ -97,8 +97,12 @@ const NativeIntersectionObserverMock = { ); observations.splice(observationIndex, 1); }, - connect: (notifyIntersectionObserversCallback?: () => void): void => { + connect: (notifyIntersectionObserversCallback: () => void): void => { invariant(callback == null, 'unexpected call to connect'); + invariant( + notifyIntersectionObserversCallback != null, + 'unexpected null notify intersection observers callback', + ); callback = notifyIntersectionObserversCallback; }, disconnect: (): void => {