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
Dawid Małecki committed
Feb 14, 2025 at 15:10 UTC
e670e72fa076449e40172e20d17cc67c1c15419c
1 file changed
+13
-12
packages/react-native-renderer/src/ReactNativeTypes.js
+13
-12
@@ -164,18 +164,19 @@ export type InspectorData = $ReadOnly<{
164
componentStack: string,
165
}>;
166
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
+>;
180
181
export type RenderRootOptions = {
182
onUncaughtError?: (