@office-iss/react-native-win32 0.81.2 → 0.82.0-preview.2

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 (209) hide show
  1. package/.flowconfig +3 -11
  2. package/CHANGELOG.json +118 -43
  3. package/CHANGELOG.md +45 -27
  4. package/IntegrationTests/IntegrationTestsApp.js +2 -2
  5. package/IntegrationTests/LayoutEventsTest.js +3 -3
  6. package/Libraries/ActionSheetIOS/ActionSheetIOS.js +7 -3
  7. package/Libraries/Alert/RCTAlertManager.android.js +4 -2
  8. package/Libraries/Animated/Animated.d.ts +2 -0
  9. package/Libraries/Animated/AnimatedEvent.js +1 -1
  10. package/Libraries/Animated/AnimatedExports.js.flow +1 -0
  11. package/Libraries/Animated/AnimatedImplementation.js +4 -2
  12. package/Libraries/Animated/AnimatedMock.js +1 -1
  13. package/Libraries/Animated/Easing.js +2 -0
  14. package/Libraries/Animated/NativeAnimatedAllowlist.js +1 -0
  15. package/Libraries/Animated/animations/Animation.js +19 -20
  16. package/Libraries/Animated/animations/TimingAnimation.js +2 -0
  17. package/Libraries/Animated/components/AnimatedScrollView.js +3 -2
  18. package/Libraries/Animated/components/AnimatedSectionList.js +1 -1
  19. package/Libraries/Animated/nodes/AnimatedColor.js +9 -9
  20. package/Libraries/Animated/nodes/AnimatedInterpolation.js +4 -4
  21. package/Libraries/Animated/nodes/AnimatedNode.js +14 -7
  22. package/Libraries/Animated/nodes/AnimatedObject.js +7 -7
  23. package/Libraries/Animated/nodes/AnimatedProps.js +32 -32
  24. package/Libraries/Animated/nodes/AnimatedStyle.js +23 -21
  25. package/Libraries/Animated/nodes/AnimatedTransform.js +6 -6
  26. package/Libraries/Animated/nodes/AnimatedValue.js +18 -26
  27. package/Libraries/AppState/AppState.js +8 -4
  28. package/Libraries/BatchedBridge/BatchedBridge.js +1 -0
  29. package/Libraries/BatchedBridge/MessageQueue.js +5 -0
  30. package/Libraries/BatchedBridge/NativeModules.js +1 -1
  31. package/Libraries/Blob/BlobManager.js +1 -1
  32. package/Libraries/Blob/URLSearchParams.js +2 -0
  33. package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.js +2 -2
  34. package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.win32.js +2 -2
  35. package/Libraries/Components/Button.js +1 -1
  36. package/Libraries/Components/Button.win32.js +1 -1
  37. package/Libraries/Components/Pressable/Pressable.js +10 -1
  38. package/Libraries/Components/Pressable/Pressable.win32.js +9 -0
  39. package/Libraries/Components/Pressable/useAndroidRippleForView.js +2 -2
  40. package/Libraries/Components/ScrollView/ScrollView.js +13 -4
  41. package/Libraries/Components/ScrollView/ScrollViewStickyHeader.js +1 -1
  42. package/Libraries/Components/StatusBar/StatusBar.js +2 -2
  43. package/Libraries/Components/Switch/Switch.js +1 -1
  44. package/Libraries/Components/TextInput/TextInput.flow.js +12 -5
  45. package/Libraries/Components/TextInput/TextInput.flow.win32.js +12 -5
  46. package/Libraries/Components/TextInput/TextInput.js +14 -5
  47. package/Libraries/Components/TextInput/TextInput.win32.js +15 -7
  48. package/Libraries/Components/TextInput/TextInputState.js +1 -1
  49. package/Libraries/Components/TextInput/TextInputState.win32.js +1 -1
  50. package/Libraries/Components/TextInput/Win32TextInputNativeComponent.js +2 -3
  51. package/Libraries/Components/Touchable/TouchableBounce.js +1 -1
  52. package/Libraries/Components/Touchable/TouchableHighlight.js +1 -1
  53. package/Libraries/Components/Touchable/TouchableNativeFeedback.js +1 -1
  54. package/Libraries/Components/Touchable/TouchableOpacity.js +1 -1
  55. package/Libraries/Components/Touchable/TouchableWin32.js +1 -1
  56. package/Libraries/Components/Touchable/TouchableWin32.js.map +1 -1
  57. package/Libraries/Components/Touchable/TouchableWithoutFeedback.js +3 -3
  58. package/Libraries/Components/View/View.js +81 -167
  59. package/Libraries/Components/View/View.win32.js +3 -1
  60. package/Libraries/Core/Devtools/loadBundleFromServer.js +1 -1
  61. package/Libraries/Core/Devtools/loadBundleFromServer.win32.js +1 -1
  62. package/Libraries/Core/ExceptionsManager.js +4 -2
  63. package/Libraries/Core/ReactFiberErrorDialog.js +3 -3
  64. package/Libraries/Core/ReactNativeVersion.js +37 -10
  65. package/Libraries/Core/Timers/JSTimers.js +4 -1
  66. package/Libraries/Core/Timers/NativeTiming.js +1 -0
  67. package/Libraries/Core/Timers/immediateShim.js +2 -1
  68. package/Libraries/Core/Timers/queueMicrotask.js +1 -0
  69. package/Libraries/Core/setUpPerformance.js +3 -4
  70. package/Libraries/Debugging/DebuggingOverlayRegistry.js +5 -3
  71. package/Libraries/Image/Image.android.js +327 -111
  72. package/Libraries/Image/Image.ios.js +6 -1
  73. package/Libraries/Image/Image.win32.js +6 -1
  74. package/Libraries/Image/ImageSourceUtils.js +8 -2
  75. package/Libraries/Image/assetPaths.js +1 -1
  76. package/Libraries/Image/resolveAssetSource.js +1 -1
  77. package/Libraries/Image/resolveAssetSource.win32.js +6 -7
  78. package/Libraries/Interaction/InteractionManager.js +118 -167
  79. package/Libraries/Interaction/PanResponder.js +7 -52
  80. package/Libraries/LayoutAnimation/LayoutAnimation.js +2 -0
  81. package/Libraries/Lists/FlatList.js +5 -6
  82. package/Libraries/LogBox/Data/LogBoxData.js +5 -2
  83. package/Libraries/LogBox/Data/parseLogBoxLog.js +1 -1
  84. package/Libraries/LogBox/UI/LogBoxInspectorHeader.win32.js +2 -2
  85. package/Libraries/LogBox/UI/LogBoxInspectorSourceMapStatus.js +1 -1
  86. package/Libraries/LogBox/UI/LogBoxInspectorSourceMapStatus.win32.js +1 -1
  87. package/Libraries/Modal/Modal.js +3 -3
  88. package/Libraries/NativeComponent/NativeComponentRegistry.js +1 -1
  89. package/Libraries/NativeComponent/ViewConfig.js +2 -2
  90. package/Libraries/Network/RCTNetworking.android.js +1 -1
  91. package/Libraries/Network/RCTNetworking.ios.js +1 -1
  92. package/Libraries/Network/RCTNetworking.win32.js +1 -1
  93. package/Libraries/Network/XMLHttpRequest.js +20 -5
  94. package/Libraries/Network/convertRequestBody.js +1 -1
  95. package/Libraries/PermissionsAndroid/PermissionsAndroid.js +10 -9
  96. package/Libraries/Pressability/HoverState.js +2 -0
  97. package/Libraries/Pressability/HoverState.win32.js +2 -0
  98. package/Libraries/Pressability/Pressability.js +1 -1
  99. package/Libraries/Pressability/Pressability.win32.js +1 -1
  100. package/Libraries/PushNotificationIOS/PushNotificationIOS.js +2 -2
  101. package/Libraries/ReactNative/AppRegistryImpl.js +4 -2
  102. package/Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricHostComponent.js +2 -0
  103. package/Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricPublicInstance.js +3 -3
  104. package/Libraries/ReactNative/RendererImplementation.js +116 -116
  105. package/Libraries/ReactNative/UIManager.js +3 -3
  106. package/Libraries/ReactNative/renderApplication.js +1 -0
  107. package/Libraries/ReactPrivate/ReactNativePrivateInterface.js +1 -1
  108. package/Libraries/Renderer/implementations/ReactFabric-dev.js +38 -35
  109. package/Libraries/Renderer/implementations/ReactFabric-prod.js +51 -22
  110. package/Libraries/Renderer/implementations/ReactFabric-profiling.js +54 -24
  111. package/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js +36 -33
  112. package/Libraries/Renderer/implementations/ReactNativeRenderer-prod.js +5 -5
  113. package/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.js +5 -5
  114. package/Libraries/Renderer/shims/ReactNativeViewConfigRegistry.js +3 -1
  115. package/Libraries/Share/Share.js +4 -0
  116. package/Libraries/StyleSheet/PlatformColorValueTypes.android.js +2 -2
  117. package/Libraries/StyleSheet/PlatformColorValueTypes.ios.js +2 -2
  118. package/Libraries/StyleSheet/PlatformColorValueTypes.win32.js +4 -0
  119. package/Libraries/StyleSheet/StyleSheet.d.ts +7 -22
  120. package/Libraries/StyleSheet/StyleSheetExports.js +2 -8
  121. package/Libraries/StyleSheet/StyleSheetExports.js.flow +11 -18
  122. package/Libraries/StyleSheet/flattenStyle.js +2 -2
  123. package/Libraries/StyleSheet/processAspectRatio.js +2 -0
  124. package/Libraries/StyleSheet/processFilter.js +5 -5
  125. package/Libraries/StyleSheet/splitLayoutProps.js +2 -2
  126. package/Libraries/Text/Text.js +534 -234
  127. package/Libraries/Text/Text.win32.js +647 -274
  128. package/Libraries/Text/TextNativeComponent.js +2 -2
  129. package/Libraries/Text/TextNativeComponent.win32.js +2 -2
  130. package/Libraries/Utilities/Appearance.d.ts +3 -5
  131. package/Libraries/Utilities/Appearance.js +5 -17
  132. package/Libraries/Utilities/HMRClient.js +2 -1
  133. package/Libraries/Utilities/Platform.android.js +3 -3
  134. package/Libraries/Utilities/Platform.d.ts +1 -0
  135. package/Libraries/Utilities/Platform.ios.js +1 -1
  136. package/Libraries/Utilities/Platform.win32.js +3 -3
  137. package/Libraries/Utilities/PlatformTypes.js +1 -1
  138. package/Libraries/Utilities/ReactNativeTestTools.js +12 -0
  139. package/Libraries/Utilities/SceneTracker.js +1 -1
  140. package/Libraries/Utilities/codegenNativeCommands.js +1 -1
  141. package/Libraries/Utilities/codegenNativeComponent.js +1 -1
  142. package/Libraries/Utilities/createPerformanceLogger.js +32 -0
  143. package/Libraries/Utilities/deepFreezeAndThrowOnMutationInDev.js +2 -0
  144. package/Libraries/Utilities/differ/pointsDiffer.js +1 -1
  145. package/Libraries/Utilities/useMergeRefs.js +1 -1
  146. package/Libraries/WebSocket/WebSocketInterceptor.js +2 -0
  147. package/Libraries/promiseRejectionTrackingOptions.js +17 -31
  148. package/Libraries/vendor/emitter/EventEmitter.js +1 -1
  149. package/flow/bom.js.flow +223 -1
  150. package/flow/prettier.js.flow +14 -0
  151. package/index.js +14 -2
  152. package/index.win32.js +16 -2
  153. package/jest/local-setup.js +2 -2
  154. package/jest/mock.js +1 -1
  155. package/jest/mockComponent.js +9 -9
  156. package/jest/mockNativeComponent.js +3 -2
  157. package/jest/mocks/Modal.js +1 -1
  158. package/jest/mocks/ScrollView.js +1 -1
  159. package/jest/mocks/ViewNativeComponent.js +1 -1
  160. package/jest/setup.js +23 -12
  161. package/overrides.json +23 -23
  162. package/package.json +28 -27
  163. package/saveAssetPlugin.js +2 -2
  164. package/src/private/animated/NativeAnimatedHelper.js +16 -5
  165. package/src/private/animated/NativeAnimatedHelper.win32.js +16 -5
  166. package/src/private/animated/createAnimatedPropsHook.js +11 -60
  167. package/src/private/animated/createAnimatedPropsMemoHook.js +8 -54
  168. package/src/private/components/virtualview/VirtualView.js +43 -12
  169. package/src/private/components/virtualview/VirtualViewExperimentalNativeComponent.js +93 -0
  170. package/src/private/components/virtualview/VirtualViewNativeComponent.js +6 -0
  171. package/src/private/devsupport/devmenu/elementinspector/Inspector.js +2 -2
  172. package/src/private/devsupport/devmenu/elementinspector/ReactDevToolsOverlay.js +2 -2
  173. package/src/private/featureflags/ReactNativeFeatureFlags.js +85 -52
  174. package/src/private/featureflags/ReactNativeFeatureFlagsBase.js +23 -4
  175. package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +15 -6
  176. package/src/private/renderer/errorhandling/ErrorHandlers.js +3 -3
  177. package/src/private/setup/{setUpPerformanceObserver.js → setUpPerformanceModern.js} +43 -18
  178. package/src/private/specs_DEPRECATED/modules/NativeTiming.js +1 -0
  179. package/src/private/types/HostInstance.js +4 -1
  180. package/src/private/webapis/dom/nodes/ReactNativeDocument.js +22 -2
  181. package/src/private/webapis/dom/nodes/ReactNativeElement.js +1 -1
  182. package/src/private/webapis/dom/nodes/ReadOnlyElement.js +5 -3
  183. package/src/private/webapis/dom/nodes/ReadOnlyNode.js +16 -13
  184. package/src/private/webapis/dom/nodes/internals/NodeInternals.js +45 -22
  185. package/src/private/webapis/dom/nodes/internals/ReactNativeDocumentInstanceHandle.js +1 -1
  186. package/src/private/webapis/dom/nodes/specs/NativeDOM.js +26 -192
  187. package/src/private/webapis/dom/oldstylecollections/HTMLCollection.js +15 -12
  188. package/src/private/webapis/dom/oldstylecollections/NodeList.js +14 -11
  189. package/src/private/webapis/geometry/DOMRectList.js +2 -2
  190. package/src/private/webapis/intersectionobserver/internals/IntersectionObserverManager.js +19 -74
  191. package/src/private/webapis/intersectionobserver/specs/NativeIntersectionObserver.js +0 -4
  192. package/src/private/webapis/mutationobserver/internals/MutationObserverManager.js +1 -1
  193. package/src/private/webapis/performance/EventTiming.js +40 -25
  194. package/src/private/webapis/performance/LongTasks.js +35 -2
  195. package/src/private/webapis/performance/Performance.js +347 -166
  196. package/src/private/webapis/performance/PerformanceEntry.js +40 -23
  197. package/src/private/webapis/performance/PerformanceObserver.js +37 -29
  198. package/src/private/webapis/performance/ReactNativeStartupTiming.js +3 -24
  199. package/src/private/webapis/performance/ResourceTiming.js +29 -18
  200. package/src/private/webapis/performance/UserTiming.js +92 -34
  201. package/src/private/webapis/performance/UserTimingExtensibility.js.flow +38 -0
  202. package/src/private/webapis/performance/internals/RawPerformanceEntry.js +3 -4
  203. package/src/private/webapis/performance/internals/Utilities.js +9 -0
  204. package/src/private/webapis/performance/specs/NativePerformance.js +23 -23
  205. package/src/private/webapis/structuredClone/structuredClone.js +10 -10
  206. package/src-win/Libraries/Components/Touchable/TouchableWin32.tsx +1 -1
  207. package/Libraries/Interaction/InteractionManagerStub.js +0 -184
  208. package/Libraries/Interaction/TaskQueue.js +0 -183
  209. package/Libraries/ReactNative/ReactNativeFeatureFlags.js +0 -31
@@ -10,7 +10,6 @@
10
10
 
11
11
  import type {ViewProps} from './ViewPropTypes';
12
12
 
13
- import * as ReactNativeFeatureFlags from '../../../src/private/featureflags/ReactNativeFeatureFlags';
14
13
  import TextAncestorContext from '../../Text/TextAncestorContext';
15
14
  import ViewNativeComponent from './ViewNativeComponent';
16
15
  import * as React from 'react';
@@ -29,182 +28,97 @@ component View(
29
28
  ) {
30
29
  const hasTextAncestor = use(TextAncestorContext);
31
30
 
32
- let actualView;
33
- if (ReactNativeFeatureFlags.reduceDefaultPropsInView()) {
34
- const {
35
- accessibilityState,
36
- accessibilityValue,
37
- 'aria-busy': ariaBusy,
38
- 'aria-checked': ariaChecked,
39
- 'aria-disabled': ariaDisabled,
40
- 'aria-expanded': ariaExpanded,
41
- 'aria-hidden': ariaHidden,
42
- 'aria-label': ariaLabel,
43
- 'aria-labelledby': ariaLabelledBy,
44
- 'aria-live': ariaLive,
45
- 'aria-selected': ariaSelected,
46
- 'aria-valuemax': ariaValueMax,
47
- 'aria-valuemin': ariaValueMin,
48
- 'aria-valuenow': ariaValueNow,
49
- 'aria-valuetext': ariaValueText,
50
- id,
51
- tabIndex,
52
- ...otherProps
53
- } = props;
54
-
55
- // Since we destructured props, we can now treat it as mutable
56
- const processedProps = otherProps as {...ViewProps};
57
-
58
- const parsedAriaLabelledBy = ariaLabelledBy?.split(/\s*,\s*/g);
59
- if (parsedAriaLabelledBy !== undefined) {
60
- processedProps.accessibilityLabelledBy = parsedAriaLabelledBy;
61
- }
31
+ const {
32
+ accessibilityState,
33
+ accessibilityValue,
34
+ 'aria-busy': ariaBusy,
35
+ 'aria-checked': ariaChecked,
36
+ 'aria-disabled': ariaDisabled,
37
+ 'aria-expanded': ariaExpanded,
38
+ 'aria-hidden': ariaHidden,
39
+ 'aria-label': ariaLabel,
40
+ 'aria-labelledby': ariaLabelledBy,
41
+ 'aria-live': ariaLive,
42
+ 'aria-selected': ariaSelected,
43
+ 'aria-valuemax': ariaValueMax,
44
+ 'aria-valuemin': ariaValueMin,
45
+ 'aria-valuenow': ariaValueNow,
46
+ 'aria-valuetext': ariaValueText,
47
+ id,
48
+ tabIndex,
49
+ ...otherProps
50
+ } = props;
51
+
52
+ // Since we destructured props, we can now treat it as mutable
53
+ const processedProps = otherProps as {...ViewProps};
54
+
55
+ const parsedAriaLabelledBy = ariaLabelledBy?.split(/\s*,\s*/g);
56
+ if (parsedAriaLabelledBy !== undefined) {
57
+ processedProps.accessibilityLabelledBy = parsedAriaLabelledBy;
58
+ }
62
59
 
63
- if (ariaLabel !== undefined) {
64
- processedProps.accessibilityLabel = ariaLabel;
65
- }
60
+ if (ariaLabel !== undefined) {
61
+ processedProps.accessibilityLabel = ariaLabel;
62
+ }
66
63
 
67
- if (ariaLive !== undefined) {
68
- processedProps.accessibilityLiveRegion =
69
- ariaLive === 'off' ? 'none' : ariaLive;
70
- }
64
+ if (ariaLive !== undefined) {
65
+ processedProps.accessibilityLiveRegion =
66
+ ariaLive === 'off' ? 'none' : ariaLive;
67
+ }
71
68
 
72
- if (ariaHidden !== undefined) {
73
- processedProps.accessibilityElementsHidden = ariaHidden;
74
- if (ariaHidden === true) {
75
- processedProps.importantForAccessibility = 'no-hide-descendants';
76
- }
69
+ if (ariaHidden !== undefined) {
70
+ processedProps.accessibilityElementsHidden = ariaHidden;
71
+ if (ariaHidden === true) {
72
+ processedProps.importantForAccessibility = 'no-hide-descendants';
77
73
  }
74
+ }
78
75
 
79
- if (id !== undefined) {
80
- processedProps.nativeID = id;
81
- }
76
+ if (id !== undefined) {
77
+ processedProps.nativeID = id;
78
+ }
82
79
 
83
- if (tabIndex !== undefined) {
84
- processedProps.focusable = !tabIndex;
85
- }
80
+ if (tabIndex !== undefined) {
81
+ processedProps.focusable = !tabIndex;
82
+ }
86
83
 
87
- if (
88
- accessibilityState != null ||
89
- ariaBusy != null ||
90
- ariaChecked != null ||
91
- ariaDisabled != null ||
92
- ariaExpanded != null ||
93
- ariaSelected != null
94
- ) {
95
- processedProps.accessibilityState = {
96
- busy: ariaBusy ?? accessibilityState?.busy,
97
- checked: ariaChecked ?? accessibilityState?.checked,
98
- disabled: ariaDisabled ?? accessibilityState?.disabled,
99
- expanded: ariaExpanded ?? accessibilityState?.expanded,
100
- selected: ariaSelected ?? accessibilityState?.selected,
101
- };
102
- }
84
+ if (
85
+ accessibilityState != null ||
86
+ ariaBusy != null ||
87
+ ariaChecked != null ||
88
+ ariaDisabled != null ||
89
+ ariaExpanded != null ||
90
+ ariaSelected != null
91
+ ) {
92
+ processedProps.accessibilityState = {
93
+ busy: ariaBusy ?? accessibilityState?.busy,
94
+ checked: ariaChecked ?? accessibilityState?.checked,
95
+ disabled: ariaDisabled ?? accessibilityState?.disabled,
96
+ expanded: ariaExpanded ?? accessibilityState?.expanded,
97
+ selected: ariaSelected ?? accessibilityState?.selected,
98
+ };
99
+ }
103
100
 
104
- if (
105
- accessibilityValue != null ||
106
- ariaValueMax != null ||
107
- ariaValueMin != null ||
108
- ariaValueNow != null ||
109
- ariaValueText != null
110
- ) {
111
- processedProps.accessibilityValue = {
112
- max: ariaValueMax ?? accessibilityValue?.max,
113
- min: ariaValueMin ?? accessibilityValue?.min,
114
- now: ariaValueNow ?? accessibilityValue?.now,
115
- text: ariaValueText ?? accessibilityValue?.text,
116
- };
117
- }
101
+ if (
102
+ accessibilityValue != null ||
103
+ ariaValueMax != null ||
104
+ ariaValueMin != null ||
105
+ ariaValueNow != null ||
106
+ ariaValueText != null
107
+ ) {
108
+ processedProps.accessibilityValue = {
109
+ max: ariaValueMax ?? accessibilityValue?.max,
110
+ min: ariaValueMin ?? accessibilityValue?.min,
111
+ now: ariaValueNow ?? accessibilityValue?.now,
112
+ text: ariaValueText ?? accessibilityValue?.text,
113
+ };
114
+ }
118
115
 
119
- actualView =
120
- ref == null ? (
121
- <ViewNativeComponent {...processedProps} />
122
- ) : (
123
- <ViewNativeComponent {...processedProps} ref={ref} />
124
- );
125
- } else {
126
- const {
127
- accessibilityElementsHidden,
128
- accessibilityLabel,
129
- accessibilityLabelledBy,
130
- accessibilityLiveRegion,
131
- accessibilityState,
132
- accessibilityValue,
133
- 'aria-busy': ariaBusy,
134
- 'aria-checked': ariaChecked,
135
- 'aria-disabled': ariaDisabled,
136
- 'aria-expanded': ariaExpanded,
137
- 'aria-hidden': ariaHidden,
138
- 'aria-label': ariaLabel,
139
- 'aria-labelledby': ariaLabelledBy,
140
- 'aria-live': ariaLive,
141
- 'aria-selected': ariaSelected,
142
- 'aria-valuemax': ariaValueMax,
143
- 'aria-valuemin': ariaValueMin,
144
- 'aria-valuenow': ariaValueNow,
145
- 'aria-valuetext': ariaValueText,
146
- focusable,
147
- id,
148
- importantForAccessibility,
149
- nativeID,
150
- tabIndex,
151
- ...otherProps
152
- } = props;
153
- const _accessibilityLabelledBy =
154
- ariaLabelledBy?.split(/\s*,\s*/g) ?? accessibilityLabelledBy;
155
-
156
- const _accessibilityState =
157
- accessibilityState != null ||
158
- ariaBusy != null ||
159
- ariaChecked != null ||
160
- ariaDisabled != null ||
161
- ariaExpanded != null ||
162
- ariaSelected != null
163
- ? {
164
- busy: ariaBusy ?? accessibilityState?.busy,
165
- checked: ariaChecked ?? accessibilityState?.checked,
166
- disabled: ariaDisabled ?? accessibilityState?.disabled,
167
- expanded: ariaExpanded ?? accessibilityState?.expanded,
168
- selected: ariaSelected ?? accessibilityState?.selected,
169
- }
170
- : undefined;
171
-
172
- const _accessibilityValue =
173
- accessibilityValue != null ||
174
- ariaValueMax != null ||
175
- ariaValueMin != null ||
176
- ariaValueNow != null ||
177
- ariaValueText != null
178
- ? {
179
- max: ariaValueMax ?? accessibilityValue?.max,
180
- min: ariaValueMin ?? accessibilityValue?.min,
181
- now: ariaValueNow ?? accessibilityValue?.now,
182
- text: ariaValueText ?? accessibilityValue?.text,
183
- }
184
- : undefined;
185
-
186
- actualView = (
187
- <ViewNativeComponent
188
- {...otherProps}
189
- accessibilityLiveRegion={
190
- ariaLive === 'off' ? 'none' : ariaLive ?? accessibilityLiveRegion
191
- }
192
- accessibilityLabel={ariaLabel ?? accessibilityLabel}
193
- focusable={tabIndex !== undefined ? !tabIndex : focusable}
194
- accessibilityState={_accessibilityState}
195
- accessibilityElementsHidden={ariaHidden ?? accessibilityElementsHidden}
196
- accessibilityLabelledBy={_accessibilityLabelledBy}
197
- accessibilityValue={_accessibilityValue}
198
- importantForAccessibility={
199
- ariaHidden === true
200
- ? 'no-hide-descendants'
201
- : importantForAccessibility
202
- }
203
- nativeID={id ?? nativeID}
204
- ref={ref}
205
- />
116
+ const actualView =
117
+ ref == null ? (
118
+ <ViewNativeComponent {...processedProps} />
119
+ ) : (
120
+ <ViewNativeComponent {...processedProps} ref={ref} />
206
121
  );
207
- }
208
122
 
209
123
  if (hasTextAncestor) {
210
124
  return (
@@ -194,7 +194,8 @@ const View: component(
194
194
  if (React.isValidElement(child)) {
195
195
  // $FlowFixMe[incompatible-use]
196
196
  if (child.props.children) {
197
- // $FlowFixMe[incompatible-call]
197
+ // $FlowFixMe[incompatible-call] - React.Children.map types child as mixed
198
+ // $FlowFixMe[incompatible-type]
198
199
  return React.cloneElement(child, {
199
200
  accessible: false,
200
201
  children: childrenWithImportantForAccessibility(
@@ -203,6 +204,7 @@ const View: component(
203
204
  });
204
205
  } else {
205
206
  // $FlowFixMe[incompatible-call]
207
+ // $FlowFixMe[incompatible-type]
206
208
  return React.cloneElement(child, {accessible: false});
207
209
  }
208
210
  }
@@ -103,7 +103,7 @@ function asyncRequest(
103
103
  ),
104
104
  );
105
105
  } else {
106
- //$FlowFixMe[incompatible-call]
106
+ //$FlowFixMe[incompatible-type]
107
107
  resolve({body: responseText, headers});
108
108
  }
109
109
  }
@@ -103,7 +103,7 @@ function asyncRequest(
103
103
  ),
104
104
  );
105
105
  } else {
106
- //$FlowFixMe[incompatible-call]
106
+ //$FlowFixMe[incompatible-type]
107
107
  resolve({body: responseText, headers});
108
108
  }
109
109
  }
@@ -169,7 +169,7 @@ function handleException(e: mixed, isFatal: boolean) {
169
169
  inExceptionHandler = true;
170
170
  /* $FlowFixMe[class-object-subtyping] added when improving typing for this
171
171
  * parameters */
172
- // $FlowFixMe[incompatible-call]
172
+ // $FlowFixMe[incompatible-type]
173
173
  reportException(error, isFatal, reportToConsole);
174
174
  } finally {
175
175
  inExceptionHandler = false;
@@ -242,6 +242,8 @@ function reactConsoleErrorHandler(...args) {
242
242
  if (__DEV__) {
243
243
  // If we're not reporting to the console in reportException,
244
244
  // we need to report it as a console.error here.
245
+ /* $FlowFixMe[constant-condition] Error discovered during Constant
246
+ * Condition roll out. See https://fburl.com/workplace/1v97vimq. */
245
247
  if (!reportToConsole) {
246
248
  require('../LogBox/LogBox').default.addConsoleLog('error', ...args);
247
249
  }
@@ -257,7 +259,7 @@ function reactConsoleErrorHandler(...args) {
257
259
  reportException(
258
260
  /* $FlowFixMe[class-object-subtyping] added when improving typing for this
259
261
  * parameters */
260
- // $FlowFixMe[incompatible-call]
262
+ // $FlowFixMe[incompatible-type]
261
263
  error,
262
264
  isFatal,
263
265
  reportToConsole,
@@ -32,17 +32,17 @@ const ReactFiberErrorDialog = {
32
32
  if (errorValue instanceof Error) {
33
33
  /* $FlowFixMe[class-object-subtyping] added when improving typing for
34
34
  * this parameters */
35
- // $FlowFixMe[incompatible-cast]
35
+ // $FlowFixMe[incompatible-type]
36
36
  error = (errorValue: ExtendedError);
37
37
  } else if (typeof errorValue === 'string') {
38
38
  /* $FlowFixMe[class-object-subtyping] added when improving typing for
39
39
  * this parameters */
40
- // $FlowFixMe[incompatible-cast]
40
+ // $FlowFixMe[incompatible-type]
41
41
  error = (new SyntheticError(errorValue): ExtendedError);
42
42
  } else {
43
43
  /* $FlowFixMe[class-object-subtyping] added when improving typing for
44
44
  * this parameters */
45
- // $FlowFixMe[incompatible-cast]
45
+ // $FlowFixMe[incompatible-type]
46
46
  error = (new SyntheticError('Unspecified error'): ExtendedError);
47
47
  }
48
48
  try {
@@ -9,14 +9,41 @@
9
9
  * @generated by scripts/releases/set-version.js
10
10
  */
11
11
 
12
- export const version: $ReadOnly<{
13
- major: number,
14
- minor: number,
15
- patch: number,
16
- prerelease: string | null,
17
- }> = {
18
- major: 0,
19
- minor: 81,
20
- patch: 5,
21
- prerelease: null,
12
+ /**
13
+ * Object containing the current React Native version.
14
+ *
15
+ * Specifically, this is the source of truth for the resolved `react-native`
16
+ * package in the JavaScript bundle. Apps and libraries can use this to
17
+ * determine compatibility or enable version-specific features.
18
+ *
19
+ * @example
20
+ * ```js
21
+ * // Get the full version string
22
+ * const version = ReactNativeVersion.getVersionString();
23
+ *
24
+ * // Access individual version components
25
+ * const major = ReactNativeVersion.major;
26
+ * ```
27
+ */
28
+ export default class ReactNativeVersion {
29
+ static major: number = 0;
30
+ static minor: number = 82;
31
+ static patch: number = 1;
32
+ static prerelease: string | null = null;
33
+
34
+ static getVersionString(): string {
35
+ return `${this.major}.${this.minor}.${this.patch}${this.prerelease != null ? `-${this.prerelease}` : ''}`;
36
+ }
37
+ }
38
+
39
+ /**
40
+ * @deprecated Compatibility export — please import `ReactNativeVersion` from
41
+ * `react-native`.
42
+ * See https://github.com/react-native-community/discussions-and-proposals/pull/894.
43
+ */
44
+ export const version = {
45
+ major: ReactNativeVersion.major,
46
+ minor: ReactNativeVersion.minor,
47
+ patch: ReactNativeVersion.patch,
48
+ prerelease: ReactNativeVersion.prerelease,
22
49
  };
@@ -6,6 +6,7 @@
6
6
  *
7
7
  * @flow
8
8
  * @format
9
+ * @deprecated
9
10
  */
10
11
 
11
12
  import NativeTiming from './NativeTiming';
@@ -473,12 +474,14 @@ let ExportedJSTimers: {
473
474
 
474
475
  if (!NativeTiming) {
475
476
  console.warn("Timing native module is not available, can't set timers.");
476
- // $FlowFixMe[prop-missing] : we can assume timers are generally available
477
+ // $FlowFixMe[incompatible-type] : we can assume timers are generally available
477
478
  ExportedJSTimers = ({
478
479
  callReactNativeMicrotasks: JSTimers.callReactNativeMicrotasks,
479
480
  queueReactNativeMicrotask: JSTimers.queueReactNativeMicrotask,
481
+ // $FlowFixMe[incompatible-variance]
480
482
  }: typeof JSTimers);
481
483
  } else {
484
+ // $FlowFixMe[incompatible-variance]
482
485
  ExportedJSTimers = JSTimers;
483
486
  }
484
487
 
@@ -6,6 +6,7 @@
6
6
  *
7
7
  * @flow strict
8
8
  * @format
9
+ * @deprecated
9
10
  */
10
11
 
11
12
  export * from '../../../src/private/specs_DEPRECATED/modules/NativeTiming';
@@ -6,6 +6,7 @@
6
6
  *
7
7
  * @flow
8
8
  * @format
9
+ * @deprecated
9
10
  */
10
11
 
11
12
  'use strict';
@@ -40,7 +41,7 @@ export function setImmediate(callback: Function, ...args: any): number {
40
41
  clearedImmediates.delete(id);
41
42
  }
42
43
 
43
- // $FlowFixMe[incompatible-call]
44
+ // $FlowFixMe[incompatible-type]
44
45
  global.queueMicrotask(() => {
45
46
  if (!clearedImmediates.has(id)) {
46
47
  callback.apply(undefined, args);
@@ -30,6 +30,7 @@ export default function queueMicrotask(callback: Function) {
30
30
  }
31
31
 
32
32
  // Try to reuse a lazily allocated resolved promise from closure.
33
+ // $FlowFixMe[constant-condition]
33
34
  (resolvedPromise || (resolvedPromise = Promise.resolve()))
34
35
  .then(callback)
35
36
  .catch(error =>
@@ -4,18 +4,17 @@
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
- * @flow strict
7
+ * @flow strict-local
8
8
  * @format
9
9
  */
10
10
 
11
- import Performance from '../../src/private/webapis/performance/Performance';
11
+ import setUpPerformanceModern from '../../src/private/setup/setUpPerformanceModern';
12
12
  import NativePerformance from '../../src/private/webapis/performance/specs/NativePerformance';
13
13
 
14
14
  // In case if the native implementation of the Performance API is available, use it,
15
15
  // otherwise fall back to the legacy/default one, which only defines 'Performance.now()'
16
16
  if (NativePerformance) {
17
- // $FlowExpectedError[cannot-write]
18
- global.performance = new Performance();
17
+ setUpPerformanceModern();
19
18
  } else {
20
19
  if (!global.performance) {
21
20
  // $FlowExpectedError[cannot-write]
@@ -98,13 +98,13 @@ class DebuggingOverlayRegistry {
98
98
  // `canonical.publicInstance` => Fabric
99
99
  // $FlowExpectedError[prop-missing]
100
100
  if (instanceHandle.canonical?.publicInstance != null) {
101
- // $FlowExpectedError[incompatible-return]
101
+ // $FlowExpectedError[incompatible-type]
102
102
  return instanceHandle.canonical?.publicInstance;
103
103
  }
104
104
 
105
105
  // `canonical` => Legacy Fabric
106
106
  if (instanceHandle.canonical != null) {
107
- // $FlowFixMe[incompatible-return]
107
+ // $FlowFixMe[incompatible-type]
108
108
  return instanceHandle.canonical;
109
109
  }
110
110
 
@@ -124,6 +124,8 @@ class DebuggingOverlayRegistry {
124
124
  let iterator: ?ReadOnlyElement = instance;
125
125
  while (iterator != null) {
126
126
  for (const subscriber of this.#registry) {
127
+ /* $FlowFixMe[invalid-compare] Error discovered during Constant
128
+ * Condition roll out. See https://fburl.com/workplace/4oq3zi07. */
127
129
  if (subscriber.rootViewRef.current === iterator) {
128
130
  return subscriber;
129
131
  }
@@ -182,7 +184,7 @@ class DebuggingOverlayRegistry {
182
184
 
183
185
  if (
184
186
  isChildPublicInstance(
185
- // $FlowFixMe[incompatible-call] There is a lot of stuff to untangle to make types for refs work.
187
+ // $FlowFixMe[incompatible-type] There is a lot of stuff to untangle to make types for refs work.
186
188
  potentialParent.rootViewRef.current,
187
189
  // $FlowFixMe[incompatible-call] There is a lot of stuff to untangle to make types for refs work.
188
190
  potentialChild.rootViewRef.current,