Skip to content

Commit e670e72

Browse files
authored
Change TouchedViewDataAtPoint type in ReactNativeTypes to use supported by Flow tooling syntax (#32382)
## Summary The `flow-api-translator` from the `hermes` repo does not support flow type spreads. It is currently not able to digest the ReactNativeTypes file as it contains unsupported syntax. The simplest solution is to change the type of the `TouchedViewDataAtPoint` to equivalent, yet supported by the Flow tooling. In this case the intersection can be used as the `TouchedViewDataAtPoint` and `InspectorData` have no common property. ## How did you test this change? Run yarn flow native
1 parent a53da6a commit e670e72

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

packages/react-native-renderer/src/ReactNativeTypes.js

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -164,18 +164,19 @@ export type InspectorData = $ReadOnly<{
164164
componentStack: string,
165165
}>;
166166

167-
export type TouchedViewDataAtPoint = $ReadOnly<{
168-
pointerY: number,
169-
touchedViewTag?: number,
170-
frame: $ReadOnly<{
171-
top: number,
172-
left: number,
173-
width: number,
174-
height: number,
175-
}>,
176-
closestPublicInstance?: PublicInstance,
177-
...InspectorData,
178-
}>;
167+
export type TouchedViewDataAtPoint = $ReadOnly<
168+
{
169+
pointerY: number,
170+
touchedViewTag?: number,
171+
frame: $ReadOnly<{
172+
top: number,
173+
left: number,
174+
width: number,
175+
height: number,
176+
}>,
177+
closestPublicInstance?: PublicInstance,
178+
} & InspectorData,
179+
>;
179180

180181
export type RenderRootOptions = {
181182
onUncaughtError?: (

0 commit comments

Comments
 (0)