@office-iss/react-native-win32 0.0.0-canary.273 → 0.0.0-canary.275

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 (114) hide show
  1. package/.flowconfig +5 -1
  2. package/CHANGELOG.json +31 -1
  3. package/CHANGELOG.md +20 -4
  4. package/Libraries/ActionSheetIOS/ActionSheetIOS.d.ts +1 -0
  5. package/Libraries/ActionSheetIOS/ActionSheetIOS.js +13 -0
  6. package/Libraries/Animated/animations/Animation.js +1 -5
  7. package/Libraries/Animated/components/AnimatedFlatList.js +1 -1
  8. package/Libraries/Animated/components/AnimatedSectionList.js +3 -1
  9. package/Libraries/Animated/createAnimatedComponent.js +7 -7
  10. package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.js +16 -2
  11. package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.win32.js +21 -2
  12. package/Libraries/Components/ActivityIndicator/ActivityIndicator.js +1 -1
  13. package/Libraries/Components/RefreshControl/__mocks__/RefreshControlMock.js +3 -2
  14. package/Libraries/Components/ScrollView/AndroidHorizontalScrollViewNativeComponent.js +0 -1
  15. package/Libraries/Components/ScrollView/ScrollView.js +39 -78
  16. package/Libraries/Components/ScrollView/ScrollViewCommands.js +1 -1
  17. package/Libraries/Components/ScrollView/ScrollViewContext.js +2 -0
  18. package/Libraries/Components/ScrollView/ScrollViewNativeComponent.js +0 -2
  19. package/Libraries/Components/ScrollView/ScrollViewStickyHeader.js +2 -3
  20. package/Libraries/Components/TextInput/InputAccessoryView.js +1 -1
  21. package/Libraries/Components/TextInput/RCTMultilineTextInputNativeComponent.js +4 -4
  22. package/Libraries/Components/TextInput/RCTSingelineTextInputNativeComponent.js +6 -4
  23. package/Libraries/Components/TextInput/RCTTextInputViewConfig.js +1 -0
  24. package/Libraries/Components/TextInput/TextInput.flow.js +11 -9
  25. package/Libraries/Components/TextInput/TextInput.js +7 -1
  26. package/Libraries/Components/TextInput/TextInput.win32.js +8 -1
  27. package/Libraries/Components/TextInput/Win32TextInputNativeComponent.js +3 -0
  28. package/Libraries/Components/Touchable/TouchableBounce.js +1 -0
  29. package/Libraries/Components/Touchable/TouchableOpacity.js +1 -0
  30. package/Libraries/Components/Touchable/TouchableWithoutFeedback.js +1 -2
  31. package/Libraries/Components/View/ViewPropTypes.d.ts +7 -0
  32. package/Libraries/Components/View/ViewWin32.js +1 -0
  33. package/Libraries/Core/ExceptionsManager.js +41 -27
  34. package/Libraries/Core/ReactNativeVersion.js +1 -1
  35. package/Libraries/Core/__mocks__/NativeExceptionsManager.js +0 -1
  36. package/Libraries/Core/setUpErrorHandling.js +18 -22
  37. package/Libraries/Core/setUpTimers.js +4 -12
  38. package/Libraries/Image/Image.d.ts +20 -29
  39. package/Libraries/Image/ImageProps.js +2 -1
  40. package/Libraries/Image/ImageResizeMode.d.ts +8 -1
  41. package/Libraries/Image/ImageResizeMode.js +4 -1
  42. package/Libraries/Image/ImageSource.d.ts +0 -2
  43. package/Libraries/Image/ImageSource.js +0 -2
  44. package/Libraries/Image/ImageUtils.js +6 -3
  45. package/Libraries/Inspector/Inspector.win32.js +1 -1
  46. package/Libraries/Interaction/InteractionManager.js +6 -1
  47. package/Libraries/Interaction/InteractionManagerStub.js +176 -0
  48. package/Libraries/Lists/FlatList.js +2 -2
  49. package/Libraries/Lists/SectionListModern.js +7 -7
  50. package/Libraries/LogBox/Data/LogBoxData.js +2 -2
  51. package/Libraries/LogBox/LogBox.js +1 -1
  52. package/Libraries/LogBox/LogBoxInspectorContainer.js +1 -1
  53. package/Libraries/LogBox/LogBoxNotificationContainer.js +1 -1
  54. package/Libraries/LogBox/UI/AnsiHighlight.js +26 -17
  55. package/Libraries/LogBox/UI/LogBoxInspectorCodeFrame.js +6 -1
  56. package/Libraries/LogBox/UI/LogBoxInspectorCodeFrame.win32.js +6 -1
  57. package/Libraries/LogBox/UI/LogBoxInspectorHeader.js +1 -1
  58. package/Libraries/LogBox/UI/LogBoxInspectorHeader.win32.js +1 -1
  59. package/Libraries/Modal/Modal.d.ts +5 -0
  60. package/Libraries/Modal/Modal.js +19 -3
  61. package/Libraries/NativeComponent/NativeComponentRegistry.js +3 -3
  62. package/Libraries/PermissionsAndroid/PermissionsAndroid.d.ts +49 -2
  63. package/Libraries/PermissionsAndroid/PermissionsAndroid.js +4 -4
  64. package/Libraries/Pressability/usePressability.js +4 -1
  65. package/Libraries/ReactNative/AppContainer.js +1 -1
  66. package/Libraries/ReactNative/AppRegistry.js +0 -6
  67. package/Libraries/ReactNative/DisplayMode.js +1 -1
  68. package/Libraries/ReactNative/RendererImplementation.js +14 -14
  69. package/Libraries/ReactNative/getCachedComponentWithDebugName.js +1 -3
  70. package/Libraries/ReactNative/renderApplication.js +9 -8
  71. package/Libraries/ReactNative/requireNativeComponent.js +5 -2
  72. package/Libraries/Renderer/implementations/ReactFabric-dev.js +26149 -15434
  73. package/Libraries/Renderer/implementations/ReactFabric-prod.js +1630 -2675
  74. package/Libraries/Renderer/implementations/ReactFabric-profiling.js +1691 -2954
  75. package/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js +27069 -16192
  76. package/Libraries/Renderer/implementations/ReactNativeRenderer-prod.js +1657 -2714
  77. package/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.js +1733 -2980
  78. package/Libraries/Renderer/shims/ReactFabric.js +3 -3
  79. package/Libraries/Renderer/shims/ReactFeatureFlags.js +2 -2
  80. package/Libraries/Renderer/shims/ReactNative.js +3 -3
  81. package/Libraries/Renderer/shims/ReactNativeTypes.js +9 -10
  82. package/Libraries/Renderer/shims/createReactNativeComponentClass.js +2 -2
  83. package/Libraries/StyleSheet/StyleSheet.js +7 -1
  84. package/Libraries/StyleSheet/StyleSheet.win32.js +7 -1
  85. package/Libraries/StyleSheet/StyleSheetTypes.d.ts +7 -1
  86. package/Libraries/StyleSheet/StyleSheetTypes.js +5 -4
  87. package/Libraries/Utilities/BackHandler.android.js +6 -18
  88. package/Libraries/Utilities/BackHandler.d.ts +0 -4
  89. package/Libraries/Utilities/BackHandler.ios.js +0 -7
  90. package/Libraries/Utilities/BackHandler.win32.js +6 -18
  91. package/Libraries/Utilities/__mocks__/BackHandler.js +3 -8
  92. package/Libraries/Utilities/codegenNativeComponent.js +1 -1
  93. package/Libraries/__flowtests__/ReactNativeTypes-flowtest.js +1 -1
  94. package/index.js +1 -1
  95. package/index.win32.js +1 -1
  96. package/overrides.json +11 -11
  97. package/package.json +13 -13
  98. package/src/private/components/HScrollViewNativeComponents.js +1 -26
  99. package/src/private/components/SafeAreaView_INTERNAL_DO_NOT_USE.js +4 -4
  100. package/src/private/components/VScrollViewNativeComponents.js +2 -24
  101. package/src/private/featureflags/ReactNativeFeatureFlags.js +36 -46
  102. package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +7 -9
  103. package/src/private/specs/components/RCTModalHostViewNativeComponent.js +8 -0
  104. package/src/private/specs/modules/NativeAccessibilityInfo.js +6 -0
  105. package/src/private/specs/modules/NativeAccessibilityInfoWin32.js +6 -0
  106. package/src/private/specs/modules/NativeActionSheetManager.js +2 -0
  107. package/src/private/specs/modules/NativeExceptionsManager.js +0 -12
  108. package/src/private/webapis/intersectionobserver/IntersectionObserver.js +6 -0
  109. package/src/private/webapis/performance/Performance.js +1 -1
  110. package/src/private/webapis/performance/UserTiming.js +5 -5
  111. package/src-win/Libraries/Components/View/ViewPropTypes.d.ts +7 -0
  112. package/Libraries/ReactNative/ReactFabricInternals.js +0 -17
  113. package/src/private/components/useSyncOnScroll.js +0 -48
  114. package/types/experimental.d.ts +0 -59
package/.flowconfig CHANGED
@@ -88,6 +88,9 @@
88
88
  ; helloworld
89
89
  <PROJECT_ROOT>/packages/helloworld/ios/Pods/
90
90
 
91
+ ; Ignore rn-tester Pods
92
+ <PROJECT_ROOT>/packages/rn-tester/Pods/
93
+
91
94
  [untyped]
92
95
  .*/node_modules/@react-native-community/cli/.*/.*
93
96
  ; Should work out how to do this properly
@@ -136,6 +139,7 @@ suppress_type=$FlowFixMeProps
136
139
  suppress_type=$FlowFixMeState
137
140
  suppress_type=$FlowFixMeEmpty
138
141
 
142
+ ban_spread_key_props=true
139
143
 
140
144
  sharedmemory.hash_table_pow=21
141
145
 
@@ -160,4 +164,4 @@ untyped-import
160
164
  untyped-type-import
161
165
 
162
166
  [version]
163
- ^0.250.0
167
+ ^0.253.0
package/CHANGELOG.json CHANGED
@@ -2,7 +2,37 @@
2
2
  "name": "@office-iss/react-native-win32",
3
3
  "entries": [
4
4
  {
5
- "date": "Sat, 23 Nov 2024 06:22:13 GMT",
5
+ "date": "Sat, 14 Dec 2024 06:28:25 GMT",
6
+ "version": "0.0.0-canary.275",
7
+ "tag": "@office-iss/react-native-win32_v0.0.0-canary.275",
8
+ "comments": {
9
+ "prerelease": [
10
+ {
11
+ "author": "tatianakapos@microsoft.com",
12
+ "package": "@office-iss/react-native-win32",
13
+ "commit": "13d41421a38fa7ebe4c08a8f421baffebf14dac5",
14
+ "comment": "integrate RN Nightly 0.77.0-nightly-20241118-3986eefed"
15
+ }
16
+ ]
17
+ }
18
+ },
19
+ {
20
+ "date": "Fri, 06 Dec 2024 06:22:27 GMT",
21
+ "version": "0.0.0-canary.274",
22
+ "tag": "@office-iss/react-native-win32_v0.0.0-canary.274",
23
+ "comments": {
24
+ "prerelease": [
25
+ {
26
+ "author": "yajurgrover24@gmail.com",
27
+ "package": "@office-iss/react-native-win32",
28
+ "commit": "40c1c59be8c9046213d5eeffae7dfe45caedcb5a",
29
+ "comment": "Integrate 10/31"
30
+ }
31
+ ]
32
+ }
33
+ },
34
+ {
35
+ "date": "Sat, 23 Nov 2024 06:23:15 GMT",
6
36
  "version": "0.0.0-canary.273",
7
37
  "tag": "@office-iss/react-native-win32_v0.0.0-canary.273",
8
38
  "comments": {
package/CHANGELOG.md CHANGED
@@ -1,17 +1,33 @@
1
1
  # Change Log - @office-iss/react-native-win32
2
2
 
3
- <!-- This log was last generated on Sat, 23 Nov 2024 06:22:13 GMT and should not be manually modified. -->
3
+ <!-- This log was last generated on Sat, 14 Dec 2024 06:28:25 GMT and should not be manually modified. -->
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
- ## 0.0.0-canary.273
7
+ ## 0.0.0-canary.275
8
8
 
9
- Sat, 23 Nov 2024 06:22:13 GMT
9
+ Sat, 14 Dec 2024 06:28:25 GMT
10
10
 
11
11
  ### Changes
12
12
 
13
- - Integrate 10/20 (yajurgrover24@gmail.com)
13
+ - integrate RN Nightly 0.77.0-nightly-20241118-3986eefed (tatianakapos@microsoft.com)
14
14
 
15
+ ## 0.0.0-canary.274
16
+
17
+ Fri, 06 Dec 2024 06:22:27 GMT
18
+
19
+ ### Changes
20
+
21
+ - Integrate 10/31 (yajurgrover24@gmail.com)
22
+
23
+ ## 0.0.0-canary.273
24
+
25
+ Sat, 23 Nov 2024 06:23:15 GMT
26
+
27
+ ### Changes
28
+
29
+ - Integrate 10/20 (yajurgrover24@gmail.com)
30
+
15
31
  ## 0.0.0-canary.272
16
32
 
17
33
  Fri, 15 Nov 2024 06:22:29 GMT
@@ -22,6 +22,7 @@ export interface ActionSheetIOSOptions {
22
22
  anchor?: number | undefined;
23
23
  tintColor?: ColorValue | ProcessedColorValue | undefined;
24
24
  cancelButtonTintColor?: ColorValue | ProcessedColorValue | undefined;
25
+ disabledButtonTintColor?: ColorValue | ProcessedColorValue | undefined;
25
26
  userInterfaceStyle?: 'light' | 'dark' | undefined;
26
27
  disabledButtonIndices?: number[] | undefined;
27
28
  }
@@ -49,6 +49,7 @@ const ActionSheetIOS = {
49
49
  +anchor?: ?number,
50
50
  +tintColor?: ColorValue | ProcessedColorValue,
51
51
  +cancelButtonTintColor?: ColorValue | ProcessedColorValue,
52
+ +disabledButtonTintColor?: ColorValue | ProcessedColorValue,
52
53
  +userInterfaceStyle?: string,
53
54
  +disabledButtonIndices?: Array<number>,
54
55
  |},
@@ -64,6 +65,7 @@ const ActionSheetIOS = {
64
65
  const {
65
66
  tintColor,
66
67
  cancelButtonTintColor,
68
+ disabledButtonTintColor,
67
69
  destructiveButtonIndex,
68
70
  ...remainingOptions
69
71
  } = options;
@@ -77,6 +79,10 @@ const ActionSheetIOS = {
77
79
 
78
80
  const processedTintColor = processColor(tintColor);
79
81
  const processedCancelButtonTintColor = processColor(cancelButtonTintColor);
82
+ const processedDisabledButtonTintColor = processColor(
83
+ disabledButtonTintColor,
84
+ );
85
+
80
86
  invariant(
81
87
  processedTintColor == null || typeof processedTintColor === 'number',
82
88
  'Unexpected color given for ActionSheetIOS.showActionSheetWithOptions tintColor',
@@ -86,6 +92,11 @@ const ActionSheetIOS = {
86
92
  typeof processedCancelButtonTintColor === 'number',
87
93
  'Unexpected color given for ActionSheetIOS.showActionSheetWithOptions cancelButtonTintColor',
88
94
  );
95
+ invariant(
96
+ processedDisabledButtonTintColor == null ||
97
+ typeof processedDisabledButtonTintColor === 'number',
98
+ 'Unexpected color given for ActionSheetIOS.showActionSheetWithOptions disabledButtonTintColor',
99
+ );
89
100
  RCTActionSheetManager.showActionSheetWithOptions(
90
101
  {
91
102
  ...remainingOptions,
@@ -93,6 +104,8 @@ const ActionSheetIOS = {
93
104
  tintColor: processedTintColor,
94
105
  // $FlowFixMe[incompatible-call]
95
106
  cancelButtonTintColor: processedCancelButtonTintColor,
107
+ // $FlowFixMe[incompatible-call]
108
+ disabledButtonTintColor: processedDisabledButtonTintColor,
96
109
  destructiveButtonIndices,
97
110
  },
98
111
  callback,
@@ -165,11 +165,7 @@ export default class Animation {
165
165
  const callback = this.#onEnd;
166
166
  if (callback != null) {
167
167
  this.#onEnd = null;
168
- if (ReactNativeFeatureFlags.scheduleAnimatedEndCallbackInMicrotask()) {
169
- queueMicrotask(() => callback(result));
170
- } else {
171
- callback(result);
172
- }
168
+ queueMicrotask(() => callback(result));
173
169
  }
174
170
  }
175
171
  }
@@ -16,5 +16,5 @@ import * as React from 'react';
16
16
 
17
17
  export default (createAnimatedComponent(FlatList): AnimatedComponentType<
18
18
  React.ElementConfig<typeof FlatList>,
19
- React.ElementRef<typeof FlatList>,
19
+ FlatList<mixed>,
20
20
  >);
@@ -8,6 +8,7 @@
8
8
  * @format
9
9
  */
10
10
 
11
+ import type {SectionBase} from '../../Lists/SectionList';
11
12
  import type {AnimatedComponentType} from '../createAnimatedComponent';
12
13
 
13
14
  import SectionList from '../../Lists/SectionList';
@@ -16,5 +17,6 @@ import * as React from 'react';
16
17
 
17
18
  export default (createAnimatedComponent(SectionList): AnimatedComponentType<
18
19
  React.ElementConfig<typeof SectionList>,
19
- React.ElementRef<typeof SectionList>,
20
+ // $FlowExpectedError[unclear-type]
21
+ SectionList<SectionBase<any>>,
20
22
  >);
@@ -35,18 +35,18 @@ export type StrictAnimatedProps<Props: {...}> = $ReadOnly<{
35
35
  passthroughAnimatedPropExplicitValues?: ?Props,
36
36
  }>;
37
37
 
38
- export type AnimatedComponentType<
39
- Props: {...},
40
- +Instance = mixed,
41
- > = React.AbstractComponent<AnimatedProps<Props>, Instance>;
38
+ export type AnimatedComponentType<Props: {...}, +Instance = mixed> = component(
39
+ ref: React.RefSetter<Instance>,
40
+ ...AnimatedProps<Props>
41
+ );
42
42
 
43
43
  export type StrictAnimatedComponentType<
44
44
  Props: {...},
45
45
  +Instance = mixed,
46
- > = React.AbstractComponent<StrictAnimatedProps<Props>, Instance>;
46
+ > = component(ref: React.RefSetter<Instance>, ...StrictAnimatedProps<Props>);
47
47
 
48
48
  export default function createAnimatedComponent<TProps: {...}, TInstance>(
49
- Component: React.AbstractComponent<TProps, TInstance>,
49
+ Component: component(ref: React.RefSetter<TInstance>, ...TProps),
50
50
  ): AnimatedComponentType<TProps, TInstance> {
51
51
  return unstable_createAnimatedComponentWithAllowlist(Component, null);
52
52
  }
@@ -55,7 +55,7 @@ export function unstable_createAnimatedComponentWithAllowlist<
55
55
  TProps: {...},
56
56
  TInstance,
57
57
  >(
58
- Component: React.AbstractComponent<TProps, TInstance>,
58
+ Component: component(ref: React.RefSetter<TInstance>, ...TProps),
59
59
  allowlist: ?AnimatedPropsAllowlist,
60
60
  ): StrictAnimatedComponentType<TProps, TInstance> {
61
61
  const AnimatedComponent = React.forwardRef<
@@ -55,6 +55,8 @@ const EventNames: Map<
55
55
  ['highTextContrastChanged', 'highTextContrastDidChange'],
56
56
  ['screenReaderChanged', 'touchExplorationDidChange'],
57
57
  ['accessibilityServiceChanged', 'accessibilityServiceDidChange'],
58
+ ['invertColorsChanged', 'invertColorDidChange'],
59
+ ['grayscaleChanged', 'grayscaleModeDidChange'],
58
60
  ])
59
61
  : new Map([
60
62
  ['announcementFinished', 'announcementFinished'],
@@ -113,7 +115,13 @@ const AccessibilityInfo = {
113
115
  */
114
116
  isGrayscaleEnabled(): Promise<boolean> {
115
117
  if (Platform.OS === 'android') {
116
- return Promise.resolve(false);
118
+ return new Promise((resolve, reject) => {
119
+ if (NativeAccessibilityInfoAndroid?.isGrayscaleEnabled != null) {
120
+ NativeAccessibilityInfoAndroid.isGrayscaleEnabled(resolve);
121
+ } else {
122
+ reject(null);
123
+ }
124
+ });
117
125
  } else {
118
126
  return new Promise((resolve, reject) => {
119
127
  if (NativeAccessibilityManagerIOS != null) {
@@ -138,7 +146,13 @@ const AccessibilityInfo = {
138
146
  */
139
147
  isInvertColorsEnabled(): Promise<boolean> {
140
148
  if (Platform.OS === 'android') {
141
- return Promise.resolve(false);
149
+ return new Promise((resolve, reject) => {
150
+ if (NativeAccessibilityInfoAndroid?.isInvertColorsEnabled != null) {
151
+ NativeAccessibilityInfoAndroid.isInvertColorsEnabled(resolve);
152
+ } else {
153
+ reject(null);
154
+ }
155
+ });
142
156
  } else {
143
157
  return new Promise((resolve, reject) => {
144
158
  if (NativeAccessibilityManagerIOS != null) {
@@ -16,6 +16,7 @@ import {sendAccessibilityEvent} from '../../ReactNative/RendererProxy';
16
16
  import Platform from '../../Utilities/Platform';
17
17
  import legacySendAccessibilityEvent from './legacySendAccessibilityEvent';
18
18
  import NativeAccessibilityInfo from './NativeAccessibilityInfo';
19
+ import NativeAccessibilityInfoAndroid from './NativeAccessibilityInfo';
19
20
  import NativeAccessibilityInfoWin32 from './NativeAccessibilityInfoWin32';
20
21
  import NativeAccessibilityManagerIOS from './NativeAccessibilityManager';
21
22
 
@@ -56,6 +57,8 @@ const EventNames: Map<
56
57
  ['highTextContrastChanged', 'highTextContrastDidChange'],
57
58
  ['screenReaderChanged', 'touchExplorationDidChange'],
58
59
  ['accessibilityServiceChanged', 'accessibilityServiceDidChange'],
60
+ ['invertColorsChanged', 'invertColorDidChange'],
61
+ ['grayscaleChanged', 'grayscaleModeDidChange'],
59
62
  ])
60
63
  : Platform.OS === 'win32'
61
64
  ? new Map([
@@ -119,7 +122,15 @@ const AccessibilityInfo = {
119
122
  * See https://reactnative.dev/docs/accessibilityinfo#isGrayscaleEnabled
120
123
  */
121
124
  isGrayscaleEnabled(): Promise<boolean> {
122
- if (Platform.OS === 'android' || Platform.OS === 'win32') {
125
+ if (Platform.OS === 'android') {
126
+ return new Promise((resolve, reject) => {
127
+ if (NativeAccessibilityInfoAndroid?.isGrayscaleEnabled != null) {
128
+ NativeAccessibilityInfoAndroid.isGrayscaleEnabled(resolve);
129
+ } else {
130
+ reject(null);
131
+ }
132
+ });
133
+ } else if (Platform.OS === 'win32') {
123
134
  return Promise.resolve(false);
124
135
  } else {
125
136
  return new Promise((resolve, reject) => {
@@ -144,7 +155,15 @@ const AccessibilityInfo = {
144
155
  * See https://reactnative.dev/docs/accessibilityinfo#isInvertColorsEnabled
145
156
  */
146
157
  isInvertColorsEnabled(): Promise<boolean> {
147
- if (Platform.OS === 'android' || Platform.OS === 'win32') {
158
+ if (Platform.OS === 'android') {
159
+ return new Promise((resolve, reject) => {
160
+ if (NativeAccessibilityInfoAndroid?.isInvertColorsEnabled != null) {
161
+ NativeAccessibilityInfoAndroid.isInvertColorsEnabled(resolve);
162
+ } else {
163
+ reject(null);
164
+ }
165
+ });
166
+ } else if (Platform.OS === 'win32') {
148
167
  return Promise.resolve(false);
149
168
  } else {
150
169
  return new Promise((resolve, reject) => {
@@ -154,7 +154,7 @@ const ActivityIndicator = (
154
154
  */
155
155
 
156
156
  const ActivityIndicatorWithRef: component(
157
- ref: React.RefSetter<HostComponent<mixed>>,
157
+ ref: React.RefSetter<HostComponent<empty>>,
158
158
  ...props: Props
159
159
  ) = React.forwardRef(ActivityIndicator);
160
160
  ActivityIndicatorWithRef.displayName = 'ActivityIndicator';
@@ -14,8 +14,9 @@ import type {HostComponent} from '../../../Renderer/shims/ReactNativeTypes';
14
14
  import requireNativeComponent from '../../../ReactNative/requireNativeComponent';
15
15
  import * as React from 'react';
16
16
 
17
- const RCTRefreshControl: HostComponent<mixed> =
18
- requireNativeComponent<mixed>('RCTRefreshControl');
17
+ const RCTRefreshControl: HostComponent<{}> = requireNativeComponent<{}>(
18
+ 'RCTRefreshControl',
19
+ );
19
20
 
20
21
  class RefreshControlMock extends React.Component<{...}> {
21
22
  static latestRef: ?RefreshControlMock;
@@ -31,7 +31,6 @@ export const __INTERNAL_VIEW_CONFIG: PartialViewConfig = {
31
31
  pagingEnabled: true,
32
32
  persistentScrollbar: true,
33
33
  horizontal: true,
34
- enableSyncOnScroll: true,
35
34
  scrollEnabled: true,
36
35
  scrollEventThrottle: true,
37
36
  scrollPerfTag: true,
@@ -8,10 +8,6 @@
8
8
  * @flow strict-local
9
9
  */
10
10
 
11
- import type {
12
- TScrollViewNativeComponentInstance,
13
- TScrollViewNativeImperativeHandle,
14
- } from '../../../src/private/components/useSyncOnScroll';
15
11
  import type {HostInstance} from '../../Renderer/shims/ReactNativeTypes';
16
12
  import type {EdgeInsetsProp} from '../../StyleSheet/EdgeInsetsPropType';
17
13
  import type {PointProp} from '../../StyleSheet/PointPropType';
@@ -46,7 +42,6 @@ import StyleSheet from '../../StyleSheet/StyleSheet';
46
42
  import Dimensions from '../../Utilities/Dimensions';
47
43
  import dismissKeyboard from '../../Utilities/dismissKeyboard';
48
44
  import Platform from '../../Utilities/Platform';
49
- import EventEmitter from '../../vendor/emitter/EventEmitter';
50
45
  import Keyboard from '../Keyboard/Keyboard';
51
46
  import TextInputState from '../TextInput/TextInputState';
52
47
  import processDecelerationRate from './processDecelerationRate';
@@ -152,7 +147,7 @@ export type DecelerationRateType = 'fast' | 'normal' | number;
152
147
  export type ScrollResponderType = ScrollViewImperativeMethods;
153
148
 
154
149
  type PublicScrollViewInstance = $ReadOnly<{|
155
- ...$Exact<TScrollViewNativeComponentInstance>,
150
+ ...HostInstance,
156
151
  ...ScrollViewImperativeMethods,
157
152
  |}>;
158
153
 
@@ -371,10 +366,10 @@ type AndroidProps = $ReadOnly<{|
371
366
  fadingEdgeLength?: ?number,
372
367
  |}>;
373
368
 
374
- type StickyHeaderComponentType = React.AbstractComponent<
375
- ScrollViewStickyHeaderProps,
376
- $ReadOnly<interface {setNextHeaderY: number => void}>,
377
- >;
369
+ type StickyHeaderComponentType = component(
370
+ ref?: React.RefSetter<$ReadOnly<interface {setNextHeaderY: number => void}>>,
371
+ ...ScrollViewStickyHeaderProps
372
+ );
378
373
 
379
374
  export type Props = $ReadOnly<{|
380
375
  ...ViewProps,
@@ -743,10 +738,6 @@ class ScrollView extends React.Component<Props, State> {
743
738
  _subscriptionKeyboardDidShow: ?EventSubscription = null;
744
739
  _subscriptionKeyboardDidHide: ?EventSubscription = null;
745
740
 
746
- #onScrollEmitter: ?EventEmitter<{
747
- scroll: [{x: number, y: number}],
748
- }> = null;
749
-
750
741
  state: State = {
751
742
  layoutHeight: null,
752
743
  };
@@ -817,8 +808,6 @@ class ScrollView extends React.Component<Props, State> {
817
808
  if (this._scrollAnimatedValueAttachment) {
818
809
  this._scrollAnimatedValueAttachment.detach();
819
810
  }
820
-
821
- this.#onScrollEmitter?.removeAllListeners();
822
811
  }
823
812
 
824
813
  /**
@@ -844,9 +833,8 @@ class ScrollView extends React.Component<Props, State> {
844
833
  return this._innerView.nativeInstance;
845
834
  };
846
835
 
847
- getNativeScrollRef: () => TScrollViewNativeComponentInstance | null = () => {
848
- const {nativeInstance} = this._scrollView;
849
- return nativeInstance == null ? null : nativeInstance.componentRef.current;
836
+ getNativeScrollRef: () => HostInstance | null = () => {
837
+ return this._scrollView.nativeInstance;
850
838
  };
851
839
 
852
840
  /**
@@ -937,20 +925,6 @@ class ScrollView extends React.Component<Props, State> {
937
925
  Commands.flashScrollIndicators(component);
938
926
  };
939
927
 
940
- _subscribeToOnScroll: (
941
- callback: ({x: number, y: number}) => void,
942
- ) => EventSubscription = callback => {
943
- let onScrollEmitter = this.#onScrollEmitter;
944
- if (onScrollEmitter == null) {
945
- onScrollEmitter = new EventEmitter();
946
- this.#onScrollEmitter = onScrollEmitter;
947
- // This is the first subscription, so make sure the native component is
948
- // also configured to output synchronous scroll events.
949
- this._scrollView.nativeInstance?.unstable_setEnableSyncOnScroll(true);
950
- }
951
- return onScrollEmitter.addListener('scroll', callback);
952
- };
953
-
954
928
  /**
955
929
  * This method should be used as the callback to onFocus in a TextInputs'
956
930
  * parent view. Note that any module using this mixin needs to return
@@ -1154,11 +1128,6 @@ class ScrollView extends React.Component<Props, State> {
1154
1128
  _handleScroll = (e: ScrollEvent) => {
1155
1129
  this._observedScrollSinceBecomingResponder = true;
1156
1130
  this.props.onScroll && this.props.onScroll(e);
1157
-
1158
- this.#onScrollEmitter?.emit('scroll', {
1159
- x: e.nativeEvent.contentOffset.x,
1160
- y: e.nativeEvent.contentOffset.y,
1161
- });
1162
1131
  };
1163
1132
 
1164
1133
  _handleLayout = (e: LayoutEvent) => {
@@ -1181,45 +1150,36 @@ class ScrollView extends React.Component<Props, State> {
1181
1150
  (instance: InnerViewInstance): InnerViewInstance => instance,
1182
1151
  );
1183
1152
 
1184
- _scrollView: RefForwarder<
1185
- TScrollViewNativeImperativeHandle,
1186
- PublicScrollViewInstance | null,
1187
- > = createRefForwarder(nativeImperativeHandle => {
1188
- const nativeInstance = nativeImperativeHandle.componentRef.current;
1189
- if (nativeInstance == null) {
1190
- return null;
1191
- }
1192
-
1193
- // This is a hack. Ideally we would forwardRef to the underlying
1194
- // host component. However, since ScrollView has it's own methods that can be
1195
- // called as well, if we used the standard forwardRef then these
1196
- // methods wouldn't be accessible and thus be a breaking change.
1197
- //
1198
- // Therefore we edit ref to include ScrollView's public methods so that
1199
- // they are callable from the ref.
1200
-
1201
- // $FlowFixMe[prop-missing] - Known issue with appending custom methods.
1202
- const publicInstance: PublicScrollViewInstance = Object.assign(
1203
- nativeInstance,
1204
- {
1205
- getScrollResponder: this.getScrollResponder,
1206
- getScrollableNode: this.getScrollableNode,
1207
- getInnerViewNode: this.getInnerViewNode,
1208
- getInnerViewRef: this.getInnerViewRef,
1209
- getNativeScrollRef: this.getNativeScrollRef,
1210
- scrollTo: this.scrollTo,
1211
- scrollToEnd: this.scrollToEnd,
1212
- flashScrollIndicators: this.flashScrollIndicators,
1213
- scrollResponderZoomTo: this.scrollResponderZoomTo,
1214
- // TODO: Replace unstable_subscribeToOnScroll once scrollView.addEventListener('scroll', (e: ScrollEvent) => {}, {passive: false});
1215
- unstable_subscribeToOnScroll: this._subscribeToOnScroll,
1216
- scrollResponderScrollNativeHandleToKeyboard:
1217
- this.scrollResponderScrollNativeHandleToKeyboard,
1218
- },
1219
- );
1153
+ _scrollView: RefForwarder<HostInstance, PublicScrollViewInstance | null> =
1154
+ createRefForwarder(nativeInstance => {
1155
+ // This is a hack. Ideally we would forwardRef to the underlying
1156
+ // host component. However, since ScrollView has it's own methods that can be
1157
+ // called as well, if we used the standard forwardRef then these
1158
+ // methods wouldn't be accessible and thus be a breaking change.
1159
+ //
1160
+ // Therefore we edit ref to include ScrollView's public methods so that
1161
+ // they are callable from the ref.
1162
+
1163
+ // $FlowFixMe[prop-missing] - Known issue with appending custom methods.
1164
+ const publicInstance: PublicScrollViewInstance = Object.assign(
1165
+ nativeInstance,
1166
+ {
1167
+ getScrollResponder: this.getScrollResponder,
1168
+ getScrollableNode: this.getScrollableNode,
1169
+ getInnerViewNode: this.getInnerViewNode,
1170
+ getInnerViewRef: this.getInnerViewRef,
1171
+ getNativeScrollRef: this.getNativeScrollRef,
1172
+ scrollTo: this.scrollTo,
1173
+ scrollToEnd: this.scrollToEnd,
1174
+ flashScrollIndicators: this.flashScrollIndicators,
1175
+ scrollResponderZoomTo: this.scrollResponderZoomTo,
1176
+ scrollResponderScrollNativeHandleToKeyboard:
1177
+ this.scrollResponderScrollNativeHandleToKeyboard,
1178
+ },
1179
+ );
1220
1180
 
1221
- return publicInstance;
1222
- });
1181
+ return publicInstance;
1182
+ });
1223
1183
 
1224
1184
  /**
1225
1185
  * Warning, this may be called several times for a single keyboard opening.
@@ -1829,8 +1789,9 @@ class ScrollView extends React.Component<Props, State> {
1829
1789
  }
1830
1790
 
1831
1791
  const refreshControl = this.props.refreshControl;
1832
- const scrollViewRef: React.RefSetter<TScrollViewNativeImperativeHandle | null> =
1833
- this._scrollView.getForwardingRef(this.props.scrollViewRef);
1792
+ const scrollViewRef = this._scrollView.getForwardingRef(
1793
+ this.props.scrollViewRef,
1794
+ );
1834
1795
 
1835
1796
  if (refreshControl) {
1836
1797
  if (Platform.OS === 'ios') {
@@ -14,7 +14,7 @@ import type {Double} from '../../Types/CodegenTypes';
14
14
  import codegenNativeCommands from '../../Utilities/codegenNativeCommands';
15
15
  import * as React from 'react';
16
16
 
17
- type ScrollViewNativeComponentType = HostComponent<mixed>;
17
+ type ScrollViewNativeComponentType = HostComponent<{...}>;
18
18
  interface NativeCommands {
19
19
  +flashScrollIndicators: (
20
20
  viewRef: React.ElementRef<ScrollViewNativeComponentType>,
@@ -18,5 +18,7 @@ if (__DEV__) {
18
18
  }
19
19
  export default ScrollViewContext;
20
20
 
21
+ // $FlowFixMe[incompatible-type] frozen objects are readonly
21
22
  export const HORIZONTAL: Value = Object.freeze({horizontal: true});
23
+ // $FlowFixMe[incompatible-type] frozen objects are readonly
22
24
  export const VERTICAL: Value = Object.freeze({horizontal: false});
@@ -45,7 +45,6 @@ export const __INTERNAL_VIEW_CONFIG: PartialViewConfig =
45
45
  diff: require('../../Utilities/differ/pointsDiffer'),
46
46
  },
47
47
  decelerationRate: true,
48
- enableSyncOnScroll: true, // Fabric only.
49
48
  disableIntervalMomentum: true,
50
49
  maintainVisibleContentPosition: true,
51
50
  pagingEnabled: true,
@@ -135,7 +134,6 @@ export const __INTERNAL_VIEW_CONFIG: PartialViewConfig =
135
134
  contentInsetAdjustmentBehavior: true,
136
135
  decelerationRate: true,
137
136
  endDraggingSensitivityMultiplier: true,
138
- enableSyncOnScroll: true, // Fabric only.
139
137
  directionalLockEnabled: true,
140
138
  disableIntervalMomentum: true,
141
139
  indicatorStyle: true,
@@ -275,12 +275,12 @@ const ScrollViewStickyHeaderWithForwardedRef: component(
275
275
  : null;
276
276
 
277
277
  return (
278
- /* $FlowFixMe[prop-missing] passthroughAnimatedPropExplicitValues isn't properly
279
- included in the Animated.View flow type. */
280
278
  <Animated.View
281
279
  collapsable={false}
282
280
  nativeID={props.nativeID}
283
281
  onLayout={_onLayout}
282
+ /* $FlowFixMe[prop-missing] passthroughAnimatedPropExplicitValues isn't properly
283
+ included in the Animated.View flow type. */
284
284
  ref={ref}
285
285
  style={[
286
286
  child.props.style,
@@ -301,7 +301,6 @@ const ScrollViewStickyHeaderWithForwardedRef: component(
301
301
  const styles = StyleSheet.create({
302
302
  header: {
303
303
  zIndex: 10,
304
- position: 'relative',
305
304
  },
306
305
  fill: {
307
306
  flex: 1,
@@ -87,7 +87,7 @@ type Props = $ReadOnly<{|
87
87
  backgroundColor?: ?ColorValue,
88
88
  |}>;
89
89
 
90
- const InputAccessoryView: React.AbstractComponent<Props> = (props: Props) => {
90
+ const InputAccessoryView: React.ComponentType<Props> = (props: Props) => {
91
91
  const {width} = useWindowDimensions();
92
92
 
93
93
  if (Platform.OS === 'ios') {
@@ -18,7 +18,7 @@ import * as NativeComponentRegistry from '../../NativeComponent/NativeComponentR
18
18
  import codegenNativeCommands from '../../Utilities/codegenNativeCommands';
19
19
  import RCTTextInputViewConfig from './RCTTextInputViewConfig';
20
20
 
21
- type NativeType = HostComponent<mixed>;
21
+ type NativeType = HostComponent<{...}>;
22
22
 
23
23
  type NativeCommands = TextInputNativeCommands<NativeType>;
24
24
 
@@ -35,11 +35,11 @@ export const __INTERNAL_VIEW_CONFIG: PartialViewConfig = {
35
35
  },
36
36
  };
37
37
 
38
- const MultilineTextInputNativeComponent: HostComponent<mixed> =
39
- NativeComponentRegistry.get<mixed>(
38
+ const MultilineTextInputNativeComponent: HostComponent<{...}> =
39
+ NativeComponentRegistry.get<{...}>(
40
40
  'RCTMultilineTextInputView',
41
41
  () => __INTERNAL_VIEW_CONFIG,
42
42
  );
43
43
 
44
44
  // flowlint-next-line unclear-type:off
45
- export default ((MultilineTextInputNativeComponent: any): HostComponent<mixed>);
45
+ export default ((MultilineTextInputNativeComponent: any): HostComponent<{...}>);