From 8681fc2ab20aa1e5937a0bf3fc58ed03c3e0ee23 Mon Sep 17 00:00:00 2001 From: Luna Wei Date: Mon, 6 Jan 2025 13:30:10 -0800 Subject: [PATCH] Remove optionality of intersectionRect Summary: Changelog: [General][Changed] - Mark `intersectionRect` required in `NativeIntersectionObserverEntry` to reflect native logic. Reviewed By: rubennorte Differential Revision: D67868219 fbshipit-source-id: cdc15908c0cf687b13d1424a59ee1e2383811ab3 --- .../intersectionobserver/NativeIntersectionObserver.h | 2 +- .../intersectionobserver/specs/NativeIntersectionObserver.js | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/react-native/ReactCommon/react/nativemodule/intersectionobserver/NativeIntersectionObserver.h b/packages/react-native/ReactCommon/react/nativemodule/intersectionobserver/NativeIntersectionObserver.h index dcc2a6c3fd6..d0653998093 100644 --- a/packages/react-native/ReactCommon/react/nativemodule/intersectionobserver/NativeIntersectionObserver.h +++ b/packages/react-native/ReactCommon/react/nativemodule/intersectionobserver/NativeIntersectionObserver.h @@ -45,7 +45,7 @@ using NativeIntersectionObserverEntry = // rootRect RectAsTuple, // intersectionRect - std::optional, + RectAsTuple, // isIntersectingAboveThresholds bool, // time diff --git a/packages/react-native/src/private/webapis/intersectionobserver/specs/NativeIntersectionObserver.js b/packages/react-native/src/private/webapis/intersectionobserver/specs/NativeIntersectionObserver.js index e2d9a32efde..7ceba03d7d2 100644 --- a/packages/react-native/src/private/webapis/intersectionobserver/specs/NativeIntersectionObserver.js +++ b/packages/react-native/src/private/webapis/intersectionobserver/specs/NativeIntersectionObserver.js @@ -17,8 +17,7 @@ export type NativeIntersectionObserverEntry = { targetInstanceHandle: mixed, targetRect: $ReadOnlyArray, // It's actually a tuple with x, y, width and height rootRect: $ReadOnlyArray, // It's actually a tuple with x, y, width and height - // TODO(T209328432) - Remove optionality of intersectionRect when native changes are released - intersectionRect: ?$ReadOnlyArray, // It's actually a tuple with x, y, width and height + intersectionRect: $ReadOnlyArray, // It's actually a tuple with x, y, width and height isIntersectingAboveThresholds: boolean, time: number, };