@office-iss/react-native-win32 0.0.0-canary.289 → 0.0.0-canary.290

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (112) hide show
  1. package/.flowconfig +1 -2
  2. package/CHANGELOG.json +16 -1
  3. package/CHANGELOG.md +13 -5
  4. package/Libraries/Animated/Animated.js.flow +1 -3
  5. package/Libraries/Animated/AnimatedExports.js.flow +12 -0
  6. package/Libraries/Animated/components/AnimatedScrollView.js +2 -1
  7. package/Libraries/Animated/components/AnimatedSectionList.js +1 -1
  8. package/Libraries/Animated/createAnimatedComponent.js +92 -56
  9. package/Libraries/Animated/nodes/AnimatedProps.js +29 -26
  10. package/Libraries/Animated/nodes/AnimatedValueXY.js +3 -1
  11. package/Libraries/AppState/AppState.js +1 -1
  12. package/Libraries/Blob/URL.js +1 -1
  13. package/Libraries/Blob/URLSearchParams.js +106 -31
  14. package/Libraries/Blob/URLSearchParams.js.flow +12 -7
  15. package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.js +1 -1
  16. package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.win32.js +1 -1
  17. package/Libraries/Components/Keyboard/Keyboard.js +1 -1
  18. package/Libraries/Components/Pressable/Pressable.js +14 -3
  19. package/Libraries/Components/Pressable/Pressable.win32.js +14 -3
  20. package/Libraries/Components/ScrollView/ScrollView.d.ts +1 -1
  21. package/Libraries/Components/ScrollView/ScrollView.js +14 -17
  22. package/Libraries/Components/Switch/Switch.d.ts +3 -0
  23. package/Libraries/Components/Switch/Switch.js +1 -1
  24. package/Libraries/Components/TextInput/TextInput.d.ts +64 -33
  25. package/Libraries/Components/TextInput/TextInput.flow.js +15 -16
  26. package/Libraries/Components/TextInput/TextInput.js +34 -27
  27. package/Libraries/Components/TextInput/TextInput.win32.js +34 -27
  28. package/Libraries/Components/TextInput/TextInputState.js +1 -1
  29. package/Libraries/Components/TextInput/TextInputState.win32.js +1 -1
  30. package/Libraries/Components/Touchable/TouchableBounce.js +2 -1
  31. package/Libraries/Components/Touchable/TouchableHighlight.js +1 -1
  32. package/Libraries/Components/Touchable/TouchableNativeFeedback.js +2 -2
  33. package/Libraries/Components/Touchable/TouchableNativeFeedback.win32.js +2 -2
  34. package/Libraries/Components/Touchable/TouchableOpacity.js +2 -1
  35. package/Libraries/Components/View/ViewAccessibility.js +2 -1
  36. package/Libraries/Components/View/ViewAccessibility.win32.js +2 -1
  37. package/Libraries/Components/View/ViewPropTypes.js +49 -3
  38. package/Libraries/Components/View/ViewPropTypes.win32.js +49 -3
  39. package/Libraries/Core/ReactNativeVersion.js +1 -1
  40. package/Libraries/Debugging/DebuggingOverlayRegistry.js +3 -3
  41. package/Libraries/EventEmitter/NativeEventEmitter.js +4 -2
  42. package/Libraries/EventEmitter/__mocks__/NativeEventEmitter.js +2 -2
  43. package/Libraries/Image/Image.d.ts +26 -10
  44. package/Libraries/Image/Image.js.flow +3 -3
  45. package/Libraries/Image/ImageBackground.js +2 -0
  46. package/Libraries/Image/ImageProps.js +19 -14
  47. package/Libraries/Interaction/InteractionManager.d.ts +13 -0
  48. package/Libraries/Interaction/InteractionManager.js +1 -1
  49. package/Libraries/Interaction/PanResponder.js +3 -3
  50. package/Libraries/LayoutAnimation/LayoutAnimation.js +2 -2
  51. package/Libraries/Linking/Linking.js +1 -1
  52. package/Libraries/Lists/FlatList.js +7 -10
  53. package/Libraries/Lists/SectionList.js +39 -42
  54. package/Libraries/Lists/SectionListModern.js +22 -31
  55. package/Libraries/Lists/VirtualizedList.js +1 -0
  56. package/Libraries/Lists/VirtualizedSectionList.js +1 -0
  57. package/Libraries/NativeComponent/BaseViewConfig.android.js +1 -0
  58. package/Libraries/NativeComponent/BaseViewConfig.ios.js +1 -0
  59. package/Libraries/NativeComponent/BaseViewConfig.win32.js +1 -0
  60. package/Libraries/Network/RCTNetworking.android.js +1 -1
  61. package/Libraries/Network/RCTNetworking.ios.js +1 -1
  62. package/Libraries/Network/RCTNetworking.js.flow +1 -1
  63. package/Libraries/Network/RCTNetworking.win32.js +1 -1
  64. package/Libraries/NewAppScreen/components/DebugInstructions.js +1 -3
  65. package/Libraries/NewAppScreen/components/Header.js +1 -3
  66. package/Libraries/NewAppScreen/components/HermesBadge.js +1 -3
  67. package/Libraries/NewAppScreen/components/LearnMoreLinks.js +1 -3
  68. package/Libraries/NewAppScreen/components/ReloadInstructions.js +1 -3
  69. package/Libraries/Pressability/Pressability.js +1 -1
  70. package/Libraries/Pressability/Pressability.win32.js +1 -1
  71. package/Libraries/ReactNative/AppContainer-dev.js +2 -2
  72. package/Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricHostComponent.js +2 -4
  73. package/Libraries/ReactNative/RendererImplementation.js +4 -0
  74. package/Libraries/ReactPrivate/ReactNativePrivateInterface.js +1 -1
  75. package/Libraries/Renderer/shims/ReactNativeTypes.js +3 -3
  76. package/Libraries/StyleSheet/StyleSheet.js +25 -2
  77. package/Libraries/StyleSheet/StyleSheet.js.flow +24 -2
  78. package/Libraries/StyleSheet/StyleSheetTypes.js +13 -3
  79. package/Libraries/StyleSheet/flattenStyle.js +7 -3
  80. package/Libraries/StyleSheet/private/_TransformStyle.js +3 -3
  81. package/Libraries/Text/Text.d.ts +2 -5
  82. package/Libraries/Text/TextProps.js +3 -2
  83. package/Libraries/Text/TextProps.win32.js +3 -2
  84. package/Libraries/Types/CoreEventTypes.d.ts +6 -1
  85. package/Libraries/Types/CoreEventTypes.js +1 -1
  86. package/Libraries/Types/CoreEventTypes.win32.js +1 -1
  87. package/Libraries/Utilities/DeviceInfo.js +2 -0
  88. package/Libraries/Utilities/Dimensions.js +1 -1
  89. package/Libraries/Utilities/Dimensions.win32.js +1 -1
  90. package/Libraries/Utilities/PlatformTypes.js +9 -3
  91. package/Libraries/Utilities/ReactNativeTestTools.js +1 -1
  92. package/Libraries/vendor/core/ErrorUtils.js +2 -0
  93. package/flow/global.js +2 -0
  94. package/index.js +3 -0
  95. package/index.win32.js +3 -0
  96. package/interface.js +0 -4
  97. package/overrides.json +19 -25
  98. package/package.json +13 -13
  99. package/src/private/animated/NativeAnimatedHelper.js +3 -1
  100. package/src/private/animated/NativeAnimatedHelper.win32.js +3 -1
  101. package/src/private/animated/createAnimatedPropsHook.js +1 -0
  102. package/src/private/animated/createAnimatedPropsMemoHook.js +1 -2
  103. package/src/private/featureflags/ReactNativeFeatureFlags.js +18 -18
  104. package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +3 -3
  105. package/src/private/inspector/getInspectorDataForViewAtPoint.js +2 -2
  106. package/src/private/types/HostInstance.js +61 -3
  107. package/src/private/webapis/dom/nodes/ReactNativeElement.js +2 -5
  108. package/src-win/Libraries/Text/Text.d.ts +2 -5
  109. package/types/modules/LaunchScreen.d.ts +9 -1
  110. package/Libraries/Utilities/DeviceInfo.win32.js +0 -19
  111. package/flow/jest.js +0 -1289
  112. package/src/private/utilities/ensureInstance.js +0 -21
@@ -20,6 +20,9 @@ export type PromiseTask = {
20
20
  gen: () => Promise<any>;
21
21
  };
22
22
 
23
+ /**
24
+ * @deprecated
25
+ */
23
26
  export interface InteractionManagerStatic {
24
27
  Events: {
25
28
  interactionStart: string;
@@ -36,6 +39,8 @@ export interface InteractionManagerStatic {
36
39
  * emitted
37
40
  * @param context - Optional context object to use when invoking the
38
41
  * listener
42
+ *
43
+ * @deprecated
39
44
  */
40
45
  addListener(
41
46
  eventType: string,
@@ -46,6 +51,8 @@ export interface InteractionManagerStatic {
46
51
  /**
47
52
  * Schedule a function to run after all interactions have completed.
48
53
  * Returns a cancellable
54
+ *
55
+ * @deprecated
49
56
  */
50
57
  runAfterInteractions(task?: (() => any) | SimpleTask | PromiseTask): {
51
58
  then: (onfulfilled?: () => any, onrejected?: () => any) => Promise<any>;
@@ -55,11 +62,15 @@ export interface InteractionManagerStatic {
55
62
 
56
63
  /**
57
64
  * Notify manager that an interaction has started.
65
+ *
66
+ * @deprecated
58
67
  */
59
68
  createInteractionHandle(): Handle;
60
69
 
61
70
  /**
62
71
  * Notify manager that an interaction has completed.
72
+ *
73
+ * @deprecated
63
74
  */
64
75
  clearInteractionHandle(handle: Handle): void;
65
76
 
@@ -67,6 +78,8 @@ export interface InteractionManagerStatic {
67
78
  * A positive number will use setTimeout to schedule any tasks after
68
79
  * the eventLoopRunningTime hits the deadline value, otherwise all
69
80
  * tasks will be executed in one setImmediate batch (default).
81
+ *
82
+ * @deprecated
70
83
  */
71
84
  setDeadline(deadline: number): void;
72
85
  }
@@ -8,11 +8,11 @@
8
8
  * @flow strict-local
9
9
  */
10
10
 
11
+ import type {EventSubscription} from '../vendor/emitter/EventEmitter';
11
12
  import type {Task} from './TaskQueue';
12
13
 
13
14
  import * as ReactNativeFeatureFlags from '../../src/private/featureflags/ReactNativeFeatureFlags';
14
15
  import EventEmitter from '../vendor/emitter/EventEmitter';
15
- import type {EventSubscription} from '../vendor/emitter/EventEmitter';
16
16
 
17
17
  const BatchedBridge = require('../BatchedBridge/BatchedBridge').default;
18
18
  const infoLog = require('../Utilities/infoLog').default;
@@ -193,7 +193,7 @@ type PassiveCallback = (
193
193
  gestureState: PanResponderGestureState,
194
194
  ) => mixed;
195
195
 
196
- export type GestureResponderHandlers = {
196
+ export type GestureResponderHandlerMethods = {
197
197
  onMoveShouldSetResponder: (event: GestureResponderEvent) => boolean,
198
198
  onMoveShouldSetResponderCapture: (event: GestureResponderEvent) => boolean,
199
199
  onResponderEnd: (event: GestureResponderEvent) => void,
@@ -333,7 +333,7 @@ const PanResponder = {
333
333
  */
334
334
  _updateGestureStateOnMove(
335
335
  gestureState: PanResponderGestureState,
336
- touchHistory: $PropertyType<GestureResponderEvent, 'touchHistory'>,
336
+ touchHistory: GestureResponderEvent['touchHistory'],
337
337
  ) {
338
338
  gestureState.numberActiveTouches = touchHistory.numberActiveTouches;
339
339
  gestureState.moveX = currentCentroidXOfTouchesChangedAfter(
@@ -403,7 +403,7 @@ const PanResponder = {
403
403
  */
404
404
  create(config: PanResponderCallbacks): {
405
405
  getInteractionHandle: () => ?number,
406
- panHandlers: GestureResponderHandlers,
406
+ panHandlers: GestureResponderHandlerMethods,
407
407
  } {
408
408
  const interactionState = {
409
409
  handle: (null: ?number),
@@ -20,14 +20,14 @@ import * as ReactNativeFeatureFlags from '../../src/private/featureflags/ReactNa
20
20
  import {getFabricUIManager} from '../ReactNative/FabricUIManager';
21
21
  import Platform from '../Utilities/Platform';
22
22
 
23
+ const UIManager = require('../ReactNative/UIManager').default;
24
+
23
25
  export type {
24
26
  LayoutAnimationType,
25
27
  LayoutAnimationProperty,
26
28
  LayoutAnimationAnimationConfig as LayoutAnimationAnim,
27
29
  } from '../Renderer/shims/ReactNativeTypes';
28
30
 
29
- const UIManager = require('../ReactNative/UIManager').default;
30
-
31
31
  // Reexport type
32
32
  export type LayoutAnimationConfig = LayoutAnimationConfig_;
33
33
 
@@ -34,7 +34,7 @@ class LinkingImpl extends NativeEventEmitter<LinkingEventDefinitions> {
34
34
  */
35
35
  addEventListener<K: $Keys<LinkingEventDefinitions>>(
36
36
  eventType: K,
37
- listener: (...$ElementType<LinkingEventDefinitions, K>) => mixed,
37
+ listener: (...LinkingEventDefinitions[K]) => mixed,
38
38
  ): EventSubscription {
39
39
  return this.addListener(eventType, listener);
40
40
  }
@@ -184,17 +184,14 @@ type FlatListBaseProps<ItemT> = {
184
184
  type VirtualizedListProps = React.ElementConfig<typeof VirtualizedList>;
185
185
 
186
186
  export type FlatListProps<ItemT> = {
187
- ...$Diff<
187
+ ...Omit<
188
188
  VirtualizedListProps,
189
- {
190
- data: $PropertyType<VirtualizedListProps, 'data'>,
191
- getItem: $PropertyType<VirtualizedListProps, 'getItem'>,
192
- getItemCount: $PropertyType<VirtualizedListProps, 'getItemCount'>,
193
- getItemLayout: $PropertyType<VirtualizedListProps, 'getItemLayout'>,
194
- renderItem: $PropertyType<VirtualizedListProps, 'renderItem'>,
195
- keyExtractor: $PropertyType<VirtualizedListProps, 'keyExtractor'>,
196
- ...
197
- },
189
+ | 'data'
190
+ | 'getItem'
191
+ | 'getItemCount'
192
+ | 'getItemLayout'
193
+ | 'renderItem'
194
+ | 'keyExtractor',
198
195
  >,
199
196
  ...FlatListBaseProps<ItemT>,
200
197
  ...
@@ -12,8 +12,10 @@
12
12
 
13
13
  import type {ScrollResponderType} from '../Components/ScrollView/ScrollView';
14
14
  import type {
15
+ ListRenderItemInfo,
15
16
  ScrollToLocationParamsType,
16
17
  SectionBase as _SectionBase,
18
+ SectionData,
17
19
  VirtualizedSectionListProps,
18
20
  } from '@react-native/virtualized-lists';
19
21
 
@@ -23,11 +25,21 @@ import * as React from 'react';
23
25
 
24
26
  const VirtualizedSectionList = VirtualizedLists.VirtualizedSectionList;
25
27
 
26
- type Item = any;
28
+ type DefaultSectionT = {
29
+ [key: string]: any,
30
+ };
31
+
32
+ export type SectionBase<
33
+ SectionItemT,
34
+ SectionT = DefaultSectionT,
35
+ > = _SectionBase<SectionItemT, SectionT>;
27
36
 
28
- export type SectionBase<SectionItemT> = _SectionBase<SectionItemT>;
37
+ export type {
38
+ SectionData as SectionListData,
39
+ ScrollToLocationParamsType as SectionListScrollParams,
40
+ };
29
41
 
30
- type RequiredProps<SectionT: SectionBase<any>> = {
42
+ type RequiredProps<ItemT, SectionT = DefaultSectionT> = {
31
43
  /**
32
44
  * The actual data to render, akin to the `data` prop in [`<FlatList>`](https://reactnative.dev/docs/flatlist).
33
45
  *
@@ -39,25 +51,24 @@ type RequiredProps<SectionT: SectionBase<any>> = {
39
51
  * ItemSeparatorComponent?: ?ReactClass<{highlighted: boolean, ...}>,
40
52
  * }>
41
53
  */
42
- sections: $ReadOnlyArray<SectionT>,
54
+ sections: $ReadOnlyArray<SectionData<ItemT, SectionT>>,
43
55
  };
44
56
 
45
- type OptionalProps<SectionT: SectionBase<any>> = {
57
+ export type SectionListRenderItemInfo<ItemT, SectionT = DefaultSectionT> = {
58
+ ...ListRenderItemInfo<ItemT>,
59
+ section: SectionData<ItemT, SectionT>,
60
+ ...
61
+ };
62
+
63
+ export type SectionListRenderItem<ItemT, SectionT = DefaultSectionT> = (
64
+ info: SectionListRenderItemInfo<ItemT, SectionT>,
65
+ ) => React.Node | null;
66
+
67
+ type OptionalProps<ItemT, SectionT = DefaultSectionT> = {
46
68
  /**
47
69
  * Default renderer for every item in every section. Can be over-ridden on a per-section basis.
48
70
  */
49
- renderItem?: (info: {
50
- item: Item,
51
- index: number,
52
- section: SectionT,
53
- separators: {
54
- highlight: () => void,
55
- unhighlight: () => void,
56
- updateProps: (select: 'leading' | 'trailing', newProps: Object) => void,
57
- ...
58
- },
59
- ...
60
- }) => null | React.Node,
71
+ renderItem?: SectionListRenderItem<ItemT, SectionT>,
61
72
  /**
62
73
  * A marker property for telling the list to re-render (since it implements `PureComponent`). If
63
74
  * any of your `renderItem`, Header, Footer, etc. functions depend on anything outside of the
@@ -80,7 +91,7 @@ type OptionalProps<SectionT: SectionBase<any>> = {
80
91
  * falls back to using the index, like react does. Note that this sets keys for each item, but
81
92
  * each overall section still needs its own key.
82
93
  */
83
- keyExtractor?: ?(item: Item, index: number) => string,
94
+ keyExtractor?: ?(item: ItemT, index: number) => string,
84
95
  /**
85
96
  * Called once when the scroll position gets within `onEndReachedThreshold` of the rendered
86
97
  * content.
@@ -94,28 +105,13 @@ type OptionalProps<SectionT: SectionBase<any>> = {
94
105
  removeClippedSubviews?: boolean,
95
106
  };
96
107
 
97
- export type Props<SectionT> = {
98
- ...$Diff<
99
- VirtualizedSectionListProps<SectionT>,
100
- {
101
- getItem: $PropertyType<VirtualizedSectionListProps<SectionT>, 'getItem'>,
102
- getItemCount: $PropertyType<
103
- VirtualizedSectionListProps<SectionT>,
104
- 'getItemCount',
105
- >,
106
- renderItem: $PropertyType<
107
- VirtualizedSectionListProps<SectionT>,
108
- 'renderItem',
109
- >,
110
- keyExtractor: $PropertyType<
111
- VirtualizedSectionListProps<SectionT>,
112
- 'keyExtractor',
113
- >,
114
- ...
115
- },
108
+ export type SectionListProps<ItemT, SectionT = DefaultSectionT> = {
109
+ ...Omit<
110
+ VirtualizedSectionListProps<ItemT, SectionT>,
111
+ 'getItem' | 'getItemCount' | 'renderItem' | 'keyExtractor',
116
112
  >,
117
- ...RequiredProps<SectionT>,
118
- ...OptionalProps<SectionT>,
113
+ ...RequiredProps<ItemT, SectionT>,
114
+ ...OptionalProps<ItemT, SectionT>,
119
115
  };
120
116
 
121
117
  /**
@@ -174,9 +170,10 @@ export type Props<SectionT> = {
174
170
  *
175
171
  */
176
172
  export default class SectionList<
177
- SectionT: SectionBase<any>,
178
- > extends React.PureComponent<Props<SectionT>, void> {
179
- props: Props<SectionT>;
173
+ ItemT,
174
+ SectionT = DefaultSectionT,
175
+ > extends React.PureComponent<SectionListProps<ItemT, SectionT>> {
176
+ props: SectionListProps<ItemT, SectionT>;
180
177
 
181
178
  /**
182
179
  * Scrolls to the item at the specified `sectionIndex` and `itemIndex` (within the section)
@@ -14,6 +14,7 @@ import type {ScrollResponderType} from '../Components/ScrollView/ScrollView';
14
14
  import type {
15
15
  ScrollToLocationParamsType,
16
16
  SectionBase as _SectionBase,
17
+ SectionData,
17
18
  VirtualizedSectionListProps,
18
19
  } from '@react-native/virtualized-lists';
19
20
  import type {ElementRef} from 'react';
@@ -24,11 +25,16 @@ import React, {forwardRef, useImperativeHandle, useRef} from 'react';
24
25
 
25
26
  const VirtualizedSectionList = VirtualizedLists.VirtualizedSectionList;
26
27
 
27
- type Item = any;
28
+ type DefaultSectionT = {
29
+ [key: string]: any,
30
+ };
28
31
 
29
- export type SectionBase<SectionItemT> = _SectionBase<SectionItemT>;
32
+ export type SectionBase<
33
+ SectionItemT,
34
+ SectionT = DefaultSectionT,
35
+ > = _SectionBase<SectionItemT, SectionT>;
30
36
 
31
- type RequiredProps<SectionT: SectionBase<any>> = {
37
+ type RequiredProps<ItemT, SectionT = DefaultSectionT> = {
32
38
  /**
33
39
  * The actual data to render, akin to the `data` prop in [`<FlatList>`](https://reactnative.dev/docs/flatlist).
34
40
  *
@@ -40,17 +46,17 @@ type RequiredProps<SectionT: SectionBase<any>> = {
40
46
  * ItemSeparatorComponent?: ?ReactClass<{highlighted: boolean, ...}>,
41
47
  * }>
42
48
  */
43
- sections: $ReadOnlyArray<SectionT>,
49
+ sections: $ReadOnlyArray<SectionData<ItemT, SectionT>>,
44
50
  };
45
51
 
46
- type OptionalProps<SectionT: SectionBase<any>> = {
52
+ type OptionalProps<ItemT, SectionT = DefaultSectionT> = {
47
53
  /**
48
54
  * Default renderer for every item in every section. Can be over-ridden on a per-section basis.
49
55
  */
50
56
  renderItem?: (info: {
51
- item: Item,
57
+ item: ItemT,
52
58
  index: number,
53
- section: SectionT,
59
+ section: SectionData<ItemT, SectionT>,
54
60
  separators: {
55
61
  highlight: () => void,
56
62
  unhighlight: () => void,
@@ -81,7 +87,7 @@ type OptionalProps<SectionT: SectionBase<any>> = {
81
87
  * falls back to using the index, like react does. Note that this sets keys for each item, but
82
88
  * each overall section still needs its own key.
83
89
  */
84
- keyExtractor?: ?(item: Item, index: number) => string,
90
+ keyExtractor?: ?(item: ItemT, index: number) => string,
85
91
  /**
86
92
  * Called once when the scroll position gets within `onEndReachedThreshold` of the rendered
87
93
  * content.
@@ -95,28 +101,13 @@ type OptionalProps<SectionT: SectionBase<any>> = {
95
101
  removeClippedSubviews?: boolean,
96
102
  };
97
103
 
98
- export type Props<SectionT: SectionBase<any>> = $ReadOnly<{
99
- ...$Diff<
100
- VirtualizedSectionListProps<SectionT>,
101
- {
102
- getItem: $PropertyType<VirtualizedSectionListProps<SectionT>, 'getItem'>,
103
- getItemCount: $PropertyType<
104
- VirtualizedSectionListProps<SectionT>,
105
- 'getItemCount',
106
- >,
107
- renderItem: $PropertyType<
108
- VirtualizedSectionListProps<SectionT>,
109
- 'renderItem',
110
- >,
111
- keyExtractor: $PropertyType<
112
- VirtualizedSectionListProps<SectionT>,
113
- 'keyExtractor',
114
- >,
115
- ...
116
- },
104
+ export type Props<ItemT, SectionT = DefaultSectionT> = $ReadOnly<{
105
+ ...Omit<
106
+ VirtualizedSectionListProps<ItemT, SectionT>,
107
+ 'getItem' | 'getItemCount' | 'renderItem' | 'keyExtractor',
117
108
  >,
118
- ...RequiredProps<SectionT>,
119
- ...OptionalProps<SectionT>,
109
+ ...RequiredProps<ItemT, SectionT>,
110
+ ...OptionalProps<ItemT, SectionT>,
120
111
  }>;
121
112
 
122
113
  /**
@@ -176,8 +167,8 @@ export type Props<SectionT: SectionBase<any>> = $ReadOnly<{
176
167
  */
177
168
  const SectionList: component(
178
169
  ref?: React.RefSetter<any>,
179
- ...Props<SectionBase<any>>
180
- ) = forwardRef<Props<SectionBase<any>>, any>((props, ref) => {
170
+ ...Props<any, DefaultSectionT>
171
+ ) = forwardRef<Props<any, DefaultSectionT>, any>((props, ref) => {
181
172
  const propsWithDefaults = {
182
173
  stickySectionHeadersEnabled: Platform.OS === 'ios',
183
174
  ...props,
@@ -19,5 +19,6 @@ export type {
19
19
  ListRenderItemInfo,
20
20
  ListRenderItem,
21
21
  Separators,
22
+ VirtualizedListProps,
22
23
  } from '@react-native/virtualized-lists';
23
24
  export default VirtualizedList;
@@ -20,5 +20,6 @@ const VirtualizedSectionList: VirtualizedSectionListType =
20
20
  export type {
21
21
  SectionBase,
22
22
  ScrollToLocationParamsType,
23
+ VirtualizedSectionListProps,
23
24
  } from '@react-native/virtualized-lists';
24
25
  export default VirtualizedSectionList;
@@ -203,6 +203,7 @@ const validAttributesForNonEventProps = {
203
203
  accessibilityState: true,
204
204
  accessibilityActions: true,
205
205
  accessibilityValue: true,
206
+ experimental_accessibilityOrder: true,
206
207
  importantForAccessibility: true,
207
208
  role: true,
208
209
  rotation: true,
@@ -197,6 +197,7 @@ const validAttributesForNonEventProps = {
197
197
  accessibilityIgnoresInvertColors: true,
198
198
  accessibilityShowsLargeContentViewer: true,
199
199
  accessibilityLargeContentTitle: true,
200
+ experimental_accessibilityOrder: true,
200
201
  testID: true,
201
202
  backgroundColor: {process: require('../StyleSheet/processColor').default},
202
203
  backfaceVisibility: true,
@@ -197,6 +197,7 @@ const validAttributesForNonEventProps = {
197
197
  accessibilityIgnoresInvertColors: true,
198
198
  accessibilityShowsLargeContentViewer: true,
199
199
  accessibilityLargeContentTitle: true,
200
+ experimental_accessibilityOrder: true,
200
201
  testID: true,
201
202
  backgroundColor: {process: require('../StyleSheet/processColor').default},
202
203
  backfaceVisibility: true,
@@ -50,7 +50,7 @@ const emitter = new NativeEventEmitter<$FlowFixMe>(
50
50
  const RCTNetworking = {
51
51
  addListener<K: $Keys<RCTNetworkingEventDefinitions>>(
52
52
  eventType: K,
53
- listener: (...$ElementType<RCTNetworkingEventDefinitions, K>) => mixed,
53
+ listener: (...RCTNetworkingEventDefinitions[K]) => mixed,
54
54
  context?: mixed,
55
55
  ): EventSubscription {
56
56
  // $FlowFixMe[incompatible-call]
@@ -20,7 +20,7 @@ import {type NativeResponseType} from './XMLHttpRequest';
20
20
  const RCTNetworking = {
21
21
  addListener<K: $Keys<RCTNetworkingEventDefinitions>>(
22
22
  eventType: K,
23
- listener: (...$ElementType<RCTNetworkingEventDefinitions, K>) => mixed,
23
+ listener: (...RCTNetworkingEventDefinitions[K]) => mixed,
24
24
  context?: mixed,
25
25
  ): EventSubscription {
26
26
  // $FlowFixMe[incompatible-call]
@@ -19,7 +19,7 @@ declare const RCTNetworking: interface {
19
19
  addListener<K: $Keys<RCTNetworkingEventDefinitions>>(
20
20
  eventType: K,
21
21
  // $FlowFixMe[invalid-computed-prop]
22
- listener: (...$ElementType<RCTNetworkingEventDefinitions, K>) => mixed,
22
+ listener: (...RCTNetworkingEventDefinitions[K]) => mixed,
23
23
  context?: mixed,
24
24
  ): EventSubscription,
25
25
 
@@ -20,7 +20,7 @@ import {type NativeResponseType} from './XMLHttpRequest';
20
20
  const RCTNetworking = {
21
21
  addListener<K: $Keys<RCTNetworkingEventDefinitions>>(
22
22
  eventType: K,
23
- listener: (...$ElementType<RCTNetworkingEventDefinitions, K>) => mixed,
23
+ listener: (...RCTNetworkingEventDefinitions[K]) => mixed,
24
24
  context?: mixed,
25
25
  ): EventSubscription {
26
26
  // $FlowFixMe[incompatible-call]
@@ -8,8 +8,6 @@
8
8
  * @format
9
9
  */
10
10
 
11
- import type {Node} from 'react';
12
-
13
11
  import StyleSheet from '../../StyleSheet/StyleSheet';
14
12
  import Text from '../../Text/Text';
15
13
  import Platform from '../../Utilities/Platform';
@@ -21,7 +19,7 @@ const styles = StyleSheet.create({
21
19
  },
22
20
  });
23
21
 
24
- const DebugInstructions: () => Node = Platform.select({
22
+ const DebugInstructions: () => React.Node = Platform.select({
25
23
  ios: () => (
26
24
  <Text>
27
25
  Press <Text style={styles.highlight}>Cmd + D</Text> in the simulator or{' '}
@@ -8,8 +8,6 @@
8
8
  * @format
9
9
  */
10
10
 
11
- import type {Node} from 'react';
12
-
13
11
  import ImageBackground from '../../Image/ImageBackground';
14
12
  import StyleSheet from '../../StyleSheet/StyleSheet';
15
13
  import Text from '../../Text/Text';
@@ -18,7 +16,7 @@ import Colors from './Colors';
18
16
  import HermesBadge from './HermesBadge';
19
17
  import React from 'react';
20
18
 
21
- const Header = (): Node => {
19
+ const Header = (): React.Node => {
22
20
  const isDarkMode = useColorScheme() === 'dark';
23
21
  return (
24
22
  <ImageBackground
@@ -8,8 +8,6 @@
8
8
  * @format
9
9
  */
10
10
 
11
- import type {Node} from 'react';
12
-
13
11
  import View from '../../Components/View/View';
14
12
  import StyleSheet from '../../StyleSheet/StyleSheet';
15
13
  import Text from '../../Text/Text';
@@ -17,7 +15,7 @@ import useColorScheme from '../../Utilities/useColorScheme';
17
15
  import Colors from './Colors';
18
16
  import React from 'react';
19
17
 
20
- const HermesBadge = (): Node => {
18
+ const HermesBadge = (): React.Node => {
21
19
  const isDarkMode = useColorScheme() === 'dark';
22
20
  const version =
23
21
  global.HermesInternal?.getRuntimeProperties?.()['OSS Release Version'] ??
@@ -8,8 +8,6 @@
8
8
  * @format
9
9
  */
10
10
 
11
- import type {Node} from 'react';
12
-
13
11
  import TouchableOpacity from '../../Components/Touchable/TouchableOpacity';
14
12
  import View from '../../Components/View/View';
15
13
  import openURLInBrowser from '../../Core/Devtools/openURLInBrowser';
@@ -81,7 +79,7 @@ const links = [
81
79
  },
82
80
  ];
83
81
 
84
- const LinkList = (): Node => {
82
+ const LinkList = (): React.Node => {
85
83
  const isDarkMode = useColorScheme() === 'dark';
86
84
  return (
87
85
  <View style={styles.container}>
@@ -8,8 +8,6 @@
8
8
  * @format
9
9
  */
10
10
 
11
- import type {Node} from 'react';
12
-
13
11
  import StyleSheet from '../../StyleSheet/StyleSheet';
14
12
  import Text from '../../Text/Text';
15
13
  import Platform from '../../Utilities/Platform';
@@ -21,7 +19,7 @@ const styles = StyleSheet.create({
21
19
  },
22
20
  });
23
21
 
24
- const ReloadInstructions: () => Node = Platform.select({
22
+ const ReloadInstructions: () => React.Node = Platform.select({
25
23
  ios: () => (
26
24
  <Text>
27
25
  Press <Text style={styles.highlight}>Cmd + R</Text> in the simulator to
@@ -829,7 +829,7 @@ export default class Pressability {
829
829
  };
830
830
 
831
831
  _isTouchWithinResponderRegion(
832
- touch: $PropertyType<GestureResponderEvent, 'nativeEvent'>,
832
+ touch: GestureResponderEvent['nativeEvent'],
833
833
  responderRegion: $ReadOnly<{
834
834
  bottom: number,
835
835
  left: number,
@@ -934,7 +934,7 @@ export default class Pressability {
934
934
  };
935
935
 
936
936
  _isTouchWithinResponderRegion(
937
- touch: $PropertyType<GestureResponderEvent, 'nativeEvent'>,
937
+ touch: GestureResponderEvent['nativeEvent'],
938
938
  responderRegion: $ReadOnly<{
939
939
  bottom: number,
940
940
  left: number,
@@ -27,8 +27,8 @@ import * as React from 'react';
27
27
 
28
28
  const {useEffect, useState, useCallback} = React;
29
29
 
30
- const reactDevToolsHook: ReactDevToolsGlobalHook =
31
- window.__REACT_DEVTOOLS_GLOBAL_HOOK__;
30
+ const reactDevToolsHook: ReactDevToolsGlobalHook = (window: $FlowFixMe)
31
+ .__REACT_DEVTOOLS_GLOBAL_HOOK__;
32
32
 
33
33
  // Required for React DevTools to view / edit React Native styles in Flipper.
34
34
  // Flipper doesn't inject these values when initializing DevTools.
@@ -10,10 +10,10 @@
10
10
 
11
11
  import type {
12
12
  HostInstance,
13
- LegacyHostInstanceMethods,
14
13
  MeasureInWindowOnSuccessCallback,
15
14
  MeasureLayoutOnSuccessCallback,
16
15
  MeasureOnSuccessCallback,
16
+ NativeMethods,
17
17
  } from '../../../src/private/types/HostInstance';
18
18
  import type {
19
19
  InternalInstanceHandle,
@@ -40,9 +40,7 @@ const noop = () => {};
40
40
  /**
41
41
  * This is used for refs on host components.
42
42
  */
43
- export default class ReactFabricHostComponent
44
- implements LegacyHostInstanceMethods
45
- {
43
+ export default class ReactFabricHostComponent implements NativeMethods {
46
44
  // These need to be accessible from `ReactFabricPublicInstanceUtils`.
47
45
  __nativeTag: number;
48
46
  __internalInstanceHandle: InternalInstanceHandle;
@@ -59,17 +59,21 @@ export function renderElement({
59
59
  }
60
60
 
61
61
  export function findHostInstance_DEPRECATED<TElementType: ElementType>(
62
+ // $FlowFixMe[incompatible-call]
62
63
  componentOrHandle: ?(ElementRef<TElementType> | number),
63
64
  ): ?HostInstance {
64
65
  return require('../Renderer/shims/ReactNative').default.findHostInstance_DEPRECATED(
66
+ // $FlowFixMe[incompatible-call]
65
67
  componentOrHandle,
66
68
  );
67
69
  }
68
70
 
69
71
  export function findNodeHandle<TElementType: ElementType>(
72
+ // $FlowFixMe[incompatible-call]
70
73
  componentOrHandle: ?(ElementRef<TElementType> | number),
71
74
  ): ?number {
72
75
  return require('../Renderer/shims/ReactNative').default.findNodeHandle(
76
+ // $FlowFixMe[incompatible-call]
73
77
  componentOrHandle,
74
78
  );
75
79
  }
@@ -41,7 +41,7 @@ export type {
41
41
  HostInstance as PublicInstance,
42
42
 
43
43
  // These types are only necessary for Paper
44
- LegacyHostInstanceMethods as LegacyPublicInstance,
44
+ NativeMethods as LegacyPublicInstance,
45
45
  MeasureOnSuccessCallback,
46
46
  MeasureInWindowOnSuccessCallback,
47
47
  MeasureLayoutOnSuccessCallback,