@office-iss/react-native-win32 0.0.0-canary.295 → 0.0.0-canary.297

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 (143) hide show
  1. package/.flowconfig +3 -1
  2. package/CHANGELOG.json +37 -1
  3. package/CHANGELOG.md +25 -8
  4. package/Libraries/Animated/Animated.js +0 -1
  5. package/Libraries/Animated/Animated.js.flow +0 -1
  6. package/Libraries/Animated/AnimatedExports.js +0 -1
  7. package/Libraries/Animated/AnimatedExports.js.flow +1 -2
  8. package/Libraries/Animated/animations/Animation.js +5 -2
  9. package/Libraries/Animated/components/AnimatedScrollView.js +53 -52
  10. package/Libraries/Animated/createAnimatedComponent.js +37 -33
  11. package/Libraries/Animated/nodes/AnimatedObject.js +2 -3
  12. package/Libraries/Animated/nodes/AnimatedProps.js +1 -1
  13. package/Libraries/Animated/shouldUseTurboAnimatedModule.js +6 -1
  14. package/Libraries/AppState/AppState.js +6 -1
  15. package/Libraries/Components/ActivityIndicator/ActivityIndicator.js +19 -18
  16. package/Libraries/Components/Button.js +2 -2
  17. package/Libraries/Components/Button.win32.js +2 -2
  18. package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.android.js +2 -3
  19. package/Libraries/Components/Keyboard/KeyboardAvoidingView.js +2 -1
  20. package/Libraries/Components/LayoutConformance/LayoutConformance.js +0 -1
  21. package/Libraries/Components/Pressable/Pressable.js +9 -6
  22. package/Libraries/Components/Pressable/Pressable.win32.js +9 -6
  23. package/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.android.js +14 -13
  24. package/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.js +13 -1
  25. package/Libraries/Components/ProgressBarAndroid/ProgressBarAndroidTypes.js +29 -20
  26. package/Libraries/Components/ScrollView/ScrollView.d.ts +9 -5
  27. package/Libraries/Components/ScrollView/ScrollView.js +18 -12
  28. package/Libraries/Components/ScrollView/ScrollViewContext.js +2 -1
  29. package/Libraries/Components/ScrollView/ScrollViewNativeComponentType.js +1 -1
  30. package/Libraries/Components/ScrollView/ScrollViewStickyHeader.js +19 -6
  31. package/Libraries/Components/Switch/Switch.js +8 -2
  32. package/Libraries/Components/TextInput/AndroidTextInputNativeComponent.js +1 -5
  33. package/Libraries/Components/TextInput/TextInput.flow.js +1 -5
  34. package/Libraries/Components/TextInput/TextInput.flow.win32.js +1 -5
  35. package/Libraries/Components/TextInput/TextInput.js +26 -25
  36. package/Libraries/Components/TextInput/TextInput.win32.js +27 -25
  37. package/Libraries/Components/Touchable/TouchableBounce.js +9 -3
  38. package/Libraries/Components/Touchable/TouchableHighlight.js +9 -4
  39. package/Libraries/Components/Touchable/TouchableNativeFeedback.js +2 -1
  40. package/Libraries/Components/Touchable/TouchableNativeFeedback.win32.js +2 -0
  41. package/Libraries/Components/Touchable/TouchableOpacity.js +7 -3
  42. package/Libraries/Components/Touchable/TouchableWithoutFeedback.js +2 -2
  43. package/Libraries/Components/View/View.js +111 -25
  44. package/Libraries/Components/View/ViewAccessibility.d.ts +1 -0
  45. package/Libraries/Core/Devtools/loadBundleFromServer.js +49 -7
  46. package/Libraries/Core/Devtools/loadBundleFromServer.win32.js +49 -7
  47. package/Libraries/Core/InitializeCore.js +1 -22
  48. package/Libraries/Core/ReactNativeVersion.js +3 -2
  49. package/Libraries/Debugging/DebuggingOverlay.js +6 -8
  50. package/Libraries/Debugging/DebuggingOverlayRegistry.js +0 -1
  51. package/Libraries/Debugging/useSubscribeToDebuggingOverlayRegistry.js +0 -1
  52. package/Libraries/EventEmitter/NativeEventEmitter.js +1 -1
  53. package/Libraries/Image/AssetRegistry.js +4 -10
  54. package/Libraries/Image/AssetSourceResolver.js +17 -4
  55. package/Libraries/Image/Image.android.js +112 -106
  56. package/Libraries/Image/Image.ios.js +10 -2
  57. package/Libraries/Image/Image.win32.js +11 -3
  58. package/Libraries/Image/ImageAnalyticsTagContext.js +2 -2
  59. package/Libraries/Image/RelativeImageStub.js +1 -0
  60. package/Libraries/Lists/FlatList.d.ts +9 -5
  61. package/Libraries/Lists/FlatList.js +1 -1
  62. package/Libraries/Lists/SectionListModern.js +9 -3
  63. package/Libraries/LogBox/UI/LogBoxButton.js +2 -1
  64. package/Libraries/LogBox/UI/LogBoxInspectorReactFrames.js +2 -1
  65. package/Libraries/LogBox/UI/LogBoxInspectorReactFrames.win32.js +2 -1
  66. package/Libraries/LogBox/UI/LogBoxInspectorSourceMapStatus.js +3 -2
  67. package/Libraries/LogBox/UI/LogBoxInspectorSourceMapStatus.win32.js +3 -2
  68. package/Libraries/LogBox/UI/LogBoxInspectorStackFrames.js +2 -1
  69. package/Libraries/ReactNative/AppContainer-dev.js +4 -4
  70. package/Libraries/ReactNative/AppContainer-prod.js +0 -1
  71. package/Libraries/ReactNative/RootTag.js +2 -2
  72. package/Libraries/ReactPrivate/ReactNativePrivateInterface.js +1 -0
  73. package/Libraries/Renderer/shims/ReactNativeTypes.js +21 -25
  74. package/Libraries/Renderer/shims/ReactNativeTypes.win32.js +270 -0
  75. package/Libraries/StyleSheet/StyleSheetExports.js.flow +3 -1
  76. package/Libraries/StyleSheet/StyleSheetTypes.js +4 -3
  77. package/Libraries/StyleSheet/private/_TransformStyle.js +49 -21
  78. package/Libraries/StyleSheet/processBoxShadow.js +0 -1
  79. package/Libraries/StyleSheet/processFilter.js +0 -1
  80. package/Libraries/Text/Text.d.ts +7 -0
  81. package/Libraries/Text/Text.js +255 -244
  82. package/Libraries/Text/Text.win32.js +293 -284
  83. package/Libraries/Text/TextAncestor.js +3 -2
  84. package/Libraries/Text/TextProps.js +2 -34
  85. package/Libraries/Text/TextProps.win32.js +2 -33
  86. package/Libraries/Types/ReactDevToolsTypes.js +0 -1
  87. package/Libraries/Utilities/PerformanceLoggerContext.js +2 -2
  88. package/Libraries/Utilities/PlatformTypes.js +1 -1
  89. package/Libraries/vendor/core/ErrorUtils.js +28 -4
  90. package/index.js +0 -1
  91. package/jest/mockNativeComponent.js +2 -1
  92. package/jest/renderer.js +0 -1
  93. package/jest/resolver.js +31 -0
  94. package/jest/setup.js +1 -1
  95. package/overrides.json +27 -20
  96. package/package.json +13 -13
  97. package/src/private/animated/NativeAnimatedHelper.js +6 -1
  98. package/src/private/animated/NativeAnimatedHelper.win32.js +6 -1
  99. package/src/private/animated/createAnimatedPropsHook.js +11 -4
  100. package/src/private/animated/createAnimatedPropsMemoHook.js +0 -1
  101. package/src/private/components/safeareaview/SafeAreaView_INTERNAL_DO_NOT_USE.js +0 -1
  102. package/src/private/components/scrollview/HScrollViewNativeComponents.js +0 -1
  103. package/src/private/components/scrollview/VScrollViewNativeComponents.js +0 -1
  104. package/src/private/devsupport/rndevtools/FuseboxSessionObserver.js +0 -1
  105. package/src/private/devsupport/rndevtools/ReactDevToolsSettingsManager.android.js +8 -9
  106. package/src/private/devsupport/rndevtools/ReactDevToolsSettingsManager.ios.js +12 -15
  107. package/src/private/devsupport/rndevtools/ReactDevToolsSettingsManager.win32.js +8 -9
  108. package/src/private/devsupport/rndevtools/setUpFuseboxReactDevToolsDispatcher.js +0 -1
  109. package/src/private/devsupport/rndevtools/specs/NativeReactDevToolsRuntimeSettingsModule.js +0 -1
  110. package/src/private/featureflags/ReactNativeFeatureFlags.js +39 -4
  111. package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +5 -2
  112. package/src/private/setup/setUpDefaultReactNativeEnvironment.js +44 -0
  113. package/src/private/styles/composeStyles.js +12 -5
  114. package/src/private/webapis/dom/events/Event.js +3 -0
  115. package/src/private/webapis/dom/events/EventTarget.js +3 -0
  116. package/src/private/webapis/dom/nodes/ReactNativeElement.js +6 -23
  117. package/src/private/webapis/dom/nodes/ReadOnlyNode.js +3 -1
  118. package/src/private/webapis/dom/nodes/specs/NativeDOM.js +38 -0
  119. package/src/private/webapis/dom/oldstylecollections/HTMLCollection.js +3 -0
  120. package/src/private/webapis/dom/oldstylecollections/NodeList.js +3 -0
  121. package/src/private/webapis/errors/DOMException.js +166 -0
  122. package/src/private/webapis/geometry/DOMRect.js +5 -0
  123. package/src/private/webapis/geometry/DOMRectList.js +3 -0
  124. package/src/private/webapis/geometry/DOMRectReadOnly.js +6 -0
  125. package/src/private/webapis/intersectionobserver/IntersectionObserver.js +15 -7
  126. package/src/private/webapis/intersectionobserver/IntersectionObserverEntry.js +3 -0
  127. package/src/private/webapis/intersectionobserver/internals/IntersectionObserverManager.js +80 -18
  128. package/src/private/webapis/intersectionobserver/specs/NativeIntersectionObserver.js +12 -0
  129. package/src/private/webapis/mutationobserver/MutationObserver.js +23 -33
  130. package/src/private/webapis/mutationobserver/MutationRecord.js +3 -0
  131. package/src/private/webapis/mutationobserver/internals/MutationObserverManager.js +56 -24
  132. package/src/private/webapis/mutationobserver/specs/NativeMutationObserver.js +4 -1
  133. package/src/private/webapis/performance/MemoryInfo.js +4 -1
  134. package/src/private/webapis/performance/Performance.js +19 -8
  135. package/src/private/webapis/performance/PerformanceEntry.js +4 -0
  136. package/src/private/webapis/performance/ReactNativeStartupTiming.js +4 -1
  137. package/src/private/webapis/performance/internals/RawPerformanceEntry.js +2 -0
  138. package/src/private/webapis/structuredClone/structuredClone.js +233 -0
  139. package/src/private/webapis/webidl/PlatformObjects.js +59 -0
  140. package/src/types/globals.d.ts +42 -0
  141. package/src-win/Libraries/Components/View/ViewAccessibility.d.ts +1 -0
  142. package/src-win/Libraries/Text/Text.d.ts +7 -0
  143. package/types/index.d.ts +1 -1
@@ -8,8 +8,10 @@
8
8
  * @format
9
9
  */
10
10
 
11
+ import type {HostInstance} from '../../src/private/types/HostInstance';
11
12
  import type {ImageStyleProp} from '../StyleSheet/StyleSheet';
12
13
  import type {RootTag} from '../Types/RootTagTypes';
14
+ import type {ImageProps} from './ImageProps';
13
15
  import type {AbstractImageAndroid, ImageAndroid} from './ImageTypes.flow';
14
16
 
15
17
  import flattenStyle from '../StyleSheet/flattenStyle';
@@ -126,125 +128,129 @@ async function queryCache(
126
128
  *
127
129
  * See https://reactnative.dev/docs/image
128
130
  */
129
- let BaseImage: AbstractImageAndroid = React.forwardRef(
130
- (props, forwardedRef) => {
131
- let source = getImageSourcesFromImageProps(props) || {
132
- uri: undefined,
133
- width: undefined,
134
- height: undefined,
135
- };
136
- const defaultSource = resolveAssetSource(props.defaultSource);
137
- const loadingIndicatorSource = resolveAssetSource(
138
- props.loadingIndicatorSource,
139
- );
131
+ let BaseImage: AbstractImageAndroid = ({
132
+ ref: forwardedRef,
133
+ ...props
134
+ }: {
135
+ ref?: React.RefSetter<HostInstance>,
136
+ ...ImageProps,
137
+ }) => {
138
+ let source = getImageSourcesFromImageProps(props) || {
139
+ uri: undefined,
140
+ width: undefined,
141
+ height: undefined,
142
+ };
143
+ const defaultSource = resolveAssetSource(props.defaultSource);
144
+ const loadingIndicatorSource = resolveAssetSource(
145
+ props.loadingIndicatorSource,
146
+ );
140
147
 
141
- if (props.children != null) {
142
- throw new Error(
143
- 'The <Image> component cannot contain children. If you want to render content on top of the image, consider using the <ImageBackground> component or absolute positioning.',
144
- );
145
- }
148
+ if (props.children != null) {
149
+ throw new Error(
150
+ 'The <Image> component cannot contain children. If you want to render content on top of the image, consider using the <ImageBackground> component or absolute positioning.',
151
+ );
152
+ }
146
153
 
147
- if (props.defaultSource != null && props.loadingIndicatorSource != null) {
148
- throw new Error(
149
- 'The <Image> component cannot have defaultSource and loadingIndicatorSource at the same time. Please use either defaultSource or loadingIndicatorSource.',
150
- );
151
- }
154
+ if (props.defaultSource != null && props.loadingIndicatorSource != null) {
155
+ throw new Error(
156
+ 'The <Image> component cannot have defaultSource and loadingIndicatorSource at the same time. Please use either defaultSource or loadingIndicatorSource.',
157
+ );
158
+ }
152
159
 
153
- let style: ImageStyleProp;
154
- let sources;
155
- if (Array.isArray(source)) {
156
- style = [styles.base, props.style];
157
- sources = source;
158
- } else {
159
- const {uri} = source;
160
- if (uri === '') {
161
- console.warn('source.uri should not be an empty string');
162
- }
163
- const width = source.width ?? props.width;
164
- const height = source.height ?? props.height;
165
- style = [{width, height}, styles.base, props.style];
166
- sources = [source];
160
+ let style: ImageStyleProp;
161
+ let sources;
162
+ if (Array.isArray(source)) {
163
+ style = [styles.base, props.style];
164
+ sources = source;
165
+ } else {
166
+ const {uri} = source;
167
+ if (uri === '') {
168
+ console.warn('source.uri should not be an empty string');
167
169
  }
170
+ const width = source.width ?? props.width;
171
+ const height = source.height ?? props.height;
172
+ style = [{width, height}, styles.base, props.style];
173
+ sources = [source];
174
+ }
168
175
 
169
- const {onLoadStart, onLoad, onLoadEnd, onError} = props;
170
- const nativeProps = {
171
- ...props,
172
- style,
173
- shouldNotifyLoadEvents: !!(onLoadStart || onLoad || onLoadEnd || onError),
174
- // Both iOS and C++ sides expect to have "source" prop, whereas on Android it's "src"
175
- // (for historical reasons). So in the latter case we populate both "src" and "source",
176
- // in order to have a better alignment between platforms in the future.
177
- src: sources,
178
- source: sources,
179
- /* $FlowFixMe(>=0.78.0 site=react_native_android_fb) This issue was found
180
- * when making Flow check .android.js files. */
181
- headers: (source?.[0]?.headers || source?.headers: ?{[string]: string}),
182
- defaultSource: defaultSource ? defaultSource.uri : null,
183
- loadingIndicatorSrc: loadingIndicatorSource
184
- ? loadingIndicatorSource.uri
185
- : null,
186
- accessibilityLabel:
187
- props['aria-label'] ?? props.accessibilityLabel ?? props.alt,
188
- accessibilityLabelledBy:
189
- props?.['aria-labelledby'] ?? props?.accessibilityLabelledBy,
190
- accessible: props.alt !== undefined ? true : props.accessible,
191
- accessibilityState: {
192
- busy: props['aria-busy'] ?? props.accessibilityState?.busy,
193
- checked: props['aria-checked'] ?? props.accessibilityState?.checked,
194
- disabled: props['aria-disabled'] ?? props.accessibilityState?.disabled,
195
- expanded: props['aria-expanded'] ?? props.accessibilityState?.expanded,
196
- selected: props['aria-selected'] ?? props.accessibilityState?.selected,
197
- },
198
- };
199
-
200
- const flattenedStyle = flattenStyle<ImageStyleProp>(style);
201
- const objectFit = convertObjectFitToResizeMode(flattenedStyle?.objectFit);
202
- const resizeMode =
203
- objectFit || props.resizeMode || flattenedStyle?.resizeMode || 'cover';
176
+ const {onLoadStart, onLoad, onLoadEnd, onError} = props;
177
+ const nativeProps = {
178
+ ...props,
179
+ style,
180
+ shouldNotifyLoadEvents: !!(onLoadStart || onLoad || onLoadEnd || onError),
181
+ // Both iOS and C++ sides expect to have "source" prop, whereas on Android it's "src"
182
+ // (for historical reasons). So in the latter case we populate both "src" and "source",
183
+ // in order to have a better alignment between platforms in the future.
184
+ src: sources,
185
+ source: sources,
186
+ /* $FlowFixMe(>=0.78.0 site=react_native_android_fb) This issue was found
187
+ * when making Flow check .android.js files. */
188
+ headers: (source?.[0]?.headers || source?.headers: ?{[string]: string}),
189
+ defaultSource: defaultSource ? defaultSource.uri : null,
190
+ loadingIndicatorSrc: loadingIndicatorSource
191
+ ? loadingIndicatorSource.uri
192
+ : null,
193
+ accessibilityLabel:
194
+ props['aria-label'] ?? props.accessibilityLabel ?? props.alt,
195
+ accessibilityLabelledBy:
196
+ props?.['aria-labelledby'] ?? props?.accessibilityLabelledBy,
197
+ accessible: props.alt !== undefined ? true : props.accessible,
198
+ accessibilityState: {
199
+ busy: props['aria-busy'] ?? props.accessibilityState?.busy,
200
+ checked: props['aria-checked'] ?? props.accessibilityState?.checked,
201
+ disabled: props['aria-disabled'] ?? props.accessibilityState?.disabled,
202
+ expanded: props['aria-expanded'] ?? props.accessibilityState?.expanded,
203
+ selected: props['aria-selected'] ?? props.accessibilityState?.selected,
204
+ },
205
+ };
204
206
 
205
- const actualRef = useWrapRefWithImageAttachedCallbacks(forwardedRef);
207
+ const flattenedStyle = flattenStyle<ImageStyleProp>(style);
208
+ const objectFit = convertObjectFitToResizeMode(flattenedStyle?.objectFit);
209
+ const resizeMode =
210
+ objectFit || props.resizeMode || flattenedStyle?.resizeMode || 'cover';
206
211
 
207
- return (
208
- <ImageAnalyticsTagContext.Consumer>
209
- {analyticTag => {
210
- const nativePropsWithAnalytics =
211
- analyticTag !== null
212
- ? {
213
- ...nativeProps,
214
- internal_analyticTag: analyticTag,
215
- }
216
- : nativeProps;
217
- return (
218
- <TextAncestor.Consumer>
219
- {hasTextAncestor => {
220
- if (hasTextAncestor) {
221
- return (
222
- <TextInlineImageNativeComponent
223
- // $FlowFixMe[incompatible-type]
224
- style={style}
225
- resizeMode={resizeMode}
226
- headers={nativeProps.headers}
227
- src={sources}
228
- ref={actualRef}
229
- />
230
- );
231
- }
212
+ const actualRef = useWrapRefWithImageAttachedCallbacks(forwardedRef);
232
213
 
214
+ return (
215
+ <ImageAnalyticsTagContext.Consumer>
216
+ {analyticTag => {
217
+ const nativePropsWithAnalytics =
218
+ analyticTag !== null
219
+ ? {
220
+ ...nativeProps,
221
+ internal_analyticTag: analyticTag,
222
+ }
223
+ : nativeProps;
224
+ return (
225
+ <TextAncestor.Consumer>
226
+ {hasTextAncestor => {
227
+ if (hasTextAncestor) {
233
228
  return (
234
- <ImageViewNativeComponent
235
- {...nativePropsWithAnalytics}
229
+ <TextInlineImageNativeComponent
230
+ // $FlowFixMe[incompatible-type]
231
+ style={style}
236
232
  resizeMode={resizeMode}
233
+ headers={nativeProps.headers}
234
+ src={sources}
237
235
  ref={actualRef}
238
236
  />
239
237
  );
240
- }}
241
- </TextAncestor.Consumer>
242
- );
243
- }}
244
- </ImageAnalyticsTagContext.Consumer>
245
- );
246
- },
247
- );
238
+ }
239
+
240
+ return (
241
+ <ImageViewNativeComponent
242
+ {...nativePropsWithAnalytics}
243
+ resizeMode={resizeMode}
244
+ ref={actualRef}
245
+ />
246
+ );
247
+ }}
248
+ </TextAncestor.Consumer>
249
+ );
250
+ }}
251
+ </ImageAnalyticsTagContext.Consumer>
252
+ );
253
+ };
248
254
 
249
255
  const imageComponentDecorator = unstable_getImageComponentDecorator();
250
256
  if (imageComponentDecorator != null) {
@@ -8,8 +8,10 @@
8
8
  * @format
9
9
  */
10
10
 
11
+ import type {HostInstance} from '../../src/private/types/HostInstance';
11
12
  import type {ImageStyleProp} from '../StyleSheet/StyleSheet';
12
13
  import type {RootTag} from '../Types/RootTagTypes';
14
+ import type {ImageProps} from './ImageProps';
13
15
  import type {AbstractImageIOS, ImageIOS} from './ImageTypes.flow';
14
16
  import type {ImageSize} from './NativeImageLoaderAndroid';
15
17
 
@@ -105,7 +107,13 @@ async function queryCache(
105
107
  *
106
108
  * See https://reactnative.dev/docs/image
107
109
  */
108
- let BaseImage: AbstractImageIOS = React.forwardRef((props, forwardedRef) => {
110
+ let BaseImage: AbstractImageIOS = ({
111
+ ref: forwardedRef,
112
+ ...props
113
+ }: {
114
+ ref?: React.RefSetter<HostInstance>,
115
+ ...ImageProps,
116
+ }) => {
109
117
  const source = getImageSourcesFromImageProps(props) || {
110
118
  uri: undefined,
111
119
  width: undefined,
@@ -180,7 +188,7 @@ let BaseImage: AbstractImageIOS = React.forwardRef((props, forwardedRef) => {
180
188
  }}
181
189
  </ImageAnalyticsTagContext.Consumer>
182
190
  );
183
- });
191
+ };
184
192
 
185
193
  const imageComponentDecorator = unstable_getImageComponentDecorator();
186
194
  if (imageComponentDecorator != null) {
@@ -8,12 +8,14 @@
8
8
  * @format
9
9
  */
10
10
 
11
+ import type {HostInstance} from '../../src/private/types/HostInstance';
12
+ import type {ImageStyleProp} from '../StyleSheet/StyleSheet';
11
13
  import type {RootTag} from '../Types/RootTagTypes';
14
+ import type {ImageProps} from './ImageProps';
12
15
  import type {AbstractImageIOS, ImageIOS} from './ImageTypes.flow';
13
16
  import TextAncestor from '../Text/TextAncestor'; // [Windows]
14
17
  import invariant from 'invariant'; // [Windows]
15
18
 
16
- import type {ImageStyleProp} from '../StyleSheet/StyleSheet';
17
19
  import NativeImageLoaderWin32 from './NativeImageLoaderWin32'; // [Win32] Replace iOS
18
20
 
19
21
  import {createRootTag} from '../ReactNative/RootTag';
@@ -122,7 +124,13 @@ async function queryCache(
122
124
  *
123
125
  * See https://reactnative.dev/docs/image
124
126
  */
125
- let BaseImage: AbstractImageIOS = React.forwardRef((props, forwardedRef) => {
127
+ let BaseImage: AbstractImageIOS = ({
128
+ ref: forwardedRef,
129
+ ...props
130
+ }: {
131
+ ref?: React.RefSetter<HostInstance>,
132
+ ...ImageProps,
133
+ }) => {
126
134
  const source = getImageSourcesFromImageProps(props) || {
127
135
  uri: undefined,
128
136
  width: undefined,
@@ -215,7 +223,7 @@ let BaseImage: AbstractImageIOS = React.forwardRef((props, forwardedRef) => {
215
223
  }}
216
224
  </TextAncestor.Consumer>
217
225
  );
218
- });
226
+ };
219
227
 
220
228
  const imageComponentDecorator = unstable_getImageComponentDecorator();
221
229
  if (imageComponentDecorator != null) {
@@ -9,11 +9,11 @@
9
9
  */
10
10
 
11
11
  import * as React from 'react';
12
+ import {createContext} from 'react';
12
13
 
13
14
  type ContextType = ?string;
14
15
 
15
- const Context: React.Context<ContextType> =
16
- React.createContext<ContextType>(null);
16
+ const Context: React.Context<ContextType> = createContext<ContextType>(null);
17
17
 
18
18
  if (__DEV__) {
19
19
  Context.displayName = 'ImageAnalyticsTagContext';
@@ -27,4 +27,5 @@ const RelativeImageStub = (AssetRegistry.registerAsset({
27
27
  type: 'png',
28
28
  }): number);
29
29
 
30
+ // eslint-disable-next-line lint/no-commonjs-exports
30
31
  module.exports = RelativeImageStub;
@@ -155,16 +155,20 @@ export interface FlatListProps<ItemT> extends VirtualizedListProps<ItemT> {
155
155
  removeClippedSubviews?: boolean | undefined;
156
156
 
157
157
  /**
158
- * Fades out the edges of the scroll content.
158
+ * Controls the fading effect at the edges of the scroll content.
159
159
  *
160
- * If the value is greater than 0, the fading edges will be set accordingly
161
- * to the current scroll direction and position,
162
- * indicating if there is more content to show.
160
+ * A value greater than 0 will apply the fading effect, indicating more content is available
161
+ * to scroll.
162
+ *
163
+ * You can specify a single number to apply the same fading length to both edges.
164
+ * Alternatively, use an object with `start` and `end` properties to set different
165
+ * fading lengths for the start and end of the scroll content.
163
166
  *
164
167
  * The default value is 0.
168
+ *
165
169
  * @platform android
166
170
  */
167
- fadingEdgeLength?: number | undefined;
171
+ fadingEdgeLength?: number | {start: number; end: number} | undefined;
168
172
  }
169
173
 
170
174
  export abstract class FlatListComponent<
@@ -145,7 +145,7 @@ type OptionalProps<ItemT> = {
145
145
  /**
146
146
  * See `ScrollView` for flow type and further documentation.
147
147
  */
148
- fadingEdgeLength?: ?number,
148
+ fadingEdgeLength?: ?number | {start: number, end: number},
149
149
  /**
150
150
  * Enable an optimization to memoize the item renderer to prevent unnecessary rerenders.
151
151
  */
@@ -21,7 +21,7 @@ import type {
21
21
  import Platform from '../Utilities/Platform';
22
22
  import VirtualizedLists from '@react-native/virtualized-lists';
23
23
  import * as React from 'react';
24
- import {forwardRef, useImperativeHandle, useRef} from 'react';
24
+ import {useImperativeHandle, useRef} from 'react';
25
25
 
26
26
  const VirtualizedSectionList = VirtualizedLists.VirtualizedSectionList;
27
27
 
@@ -168,7 +168,13 @@ export type Props<ItemT, SectionT = DefaultSectionT> = $ReadOnly<{
168
168
  const SectionList: component(
169
169
  ref?: React.RefSetter<any>,
170
170
  ...Props<any, DefaultSectionT>
171
- ) = forwardRef<Props<any, DefaultSectionT>, any>((props, ref) => {
171
+ ) = ({
172
+ ref,
173
+ ...props
174
+ }: {
175
+ ref?: React.RefSetter<any>,
176
+ ...Props<any, DefaultSectionT>,
177
+ }) => {
172
178
  const propsWithDefaults = {
173
179
  stickySectionHeadersEnabled: Platform.OS === 'ios',
174
180
  ...props,
@@ -237,6 +243,6 @@ const SectionList: component(
237
243
  getItem={(items, index) => items[index]}
238
244
  />
239
245
  );
240
- });
246
+ };
241
247
 
242
248
  export default SectionList;
@@ -17,6 +17,7 @@ import View from '../../Components/View/View';
17
17
  import StyleSheet from '../../StyleSheet/StyleSheet';
18
18
  import * as LogBoxStyle from './LogBoxStyle';
19
19
  import * as React from 'react';
20
+ import {useState} from 'react';
20
21
 
21
22
  type Props = $ReadOnly<{
22
23
  id?: string,
@@ -31,7 +32,7 @@ type Props = $ReadOnly<{
31
32
  }>;
32
33
 
33
34
  function LogBoxButton(props: Props): React.Node {
34
- const [pressed, setPressed] = React.useState(false);
35
+ const [pressed, setPressed] = useState(false);
35
36
 
36
37
  let backgroundColor = props.backgroundColor;
37
38
  if (!backgroundColor) {
@@ -19,6 +19,7 @@ import LogBoxButton from './LogBoxButton';
19
19
  import LogBoxInspectorSection from './LogBoxInspectorSection';
20
20
  import * as LogBoxStyle from './LogBoxStyle';
21
21
  import * as React from 'react';
22
+ import {useState} from 'react';
22
23
 
23
24
  type Props = $ReadOnly<{
24
25
  log: LogBoxLog,
@@ -49,7 +50,7 @@ function getPrettyFileName(path: string) {
49
50
  return fileName;
50
51
  }
51
52
  function LogBoxInspectorReactFrames(props: Props): React.Node {
52
- const [collapsed, setCollapsed] = React.useState(true);
53
+ const [collapsed, setCollapsed] = useState(true);
53
54
  if (
54
55
  props.log.getAvailableComponentStack() == null ||
55
56
  props.log.getAvailableComponentStack().length < 1
@@ -19,6 +19,7 @@ import LogBoxButton from './LogBoxButton';
19
19
  import LogBoxInspectorSection from './LogBoxInspectorSection';
20
20
  import * as LogBoxStyle from './LogBoxStyle';
21
21
  import * as React from 'react';
22
+ import {useState} from 'react';
22
23
 
23
24
  type Props = $ReadOnly<{
24
25
  log: LogBoxLog,
@@ -49,7 +50,7 @@ function getPrettyFileName(path: string) {
49
50
  return fileName;
50
51
  }
51
52
  function LogBoxInspectorReactFrames(props: Props): React.Node {
52
- const [collapsed, setCollapsed] = React.useState(true);
53
+ const [collapsed, setCollapsed] = useState(true);
53
54
  if (
54
55
  props.log.getAvailableComponentStack() == null ||
55
56
  props.log.getAvailableComponentStack().length < 1
@@ -17,6 +17,7 @@ import Text from '../../Text/Text';
17
17
  import LogBoxButton from './LogBoxButton';
18
18
  import * as LogBoxStyle from './LogBoxStyle';
19
19
  import * as React from 'react';
20
+ import {useEffect, useState} from 'react';
20
21
 
21
22
  type Props = $ReadOnly<{
22
23
  onPress?: ?(event: GestureResponderEvent) => void,
@@ -24,12 +25,12 @@ type Props = $ReadOnly<{
24
25
  }>;
25
26
 
26
27
  function LogBoxInspectorSourceMapStatus(props: Props): React.Node {
27
- const [state, setState] = React.useState({
28
+ const [state, setState] = useState({
28
29
  animation: null,
29
30
  rotate: null,
30
31
  });
31
32
 
32
- React.useEffect(() => {
33
+ useEffect(() => {
33
34
  if (props.status === 'PENDING') {
34
35
  if (state.animation == null) {
35
36
  const animated = new Animated.Value(0);
@@ -17,6 +17,7 @@ import Text from '../../Text/Text';
17
17
  import LogBoxButton from './LogBoxButton';
18
18
  import * as LogBoxStyle from './LogBoxStyle';
19
19
  import * as React from 'react';
20
+ import {useEffect, useState} from 'react';
20
21
 
21
22
  type Props = $ReadOnly<{
22
23
  onPress?: ?(event: GestureResponderEvent) => void,
@@ -26,12 +27,12 @@ type Props = $ReadOnly<{
26
27
  function LogBoxInspectorSourceMapStatus(props: Props): React.Node {
27
28
  // [Win32] Dont use Animated
28
29
  /*
29
- const [state, setState] = React.useState({
30
+ const [state, setState] = useState({
30
31
  animation: null,
31
32
  rotate: null,
32
33
  });
33
34
 
34
- React.useEffect(() => {
35
+ useEffect(() => {
35
36
  if (props.status === 'PENDING') {
36
37
  if (state.animation == null) {
37
38
  const animated = new Animated.Value(0);
@@ -22,6 +22,7 @@ import LogBoxInspectorSourceMapStatus from './LogBoxInspectorSourceMapStatus';
22
22
  import LogBoxInspectorStackFrame from './LogBoxInspectorStackFrame';
23
23
  import * as LogBoxStyle from './LogBoxStyle';
24
24
  import * as React from 'react';
25
+ import {useState} from 'react';
25
26
 
26
27
  type Props = $ReadOnly<{
27
28
  log: LogBoxLog,
@@ -65,7 +66,7 @@ export function getCollapseMessage(
65
66
  }
66
67
 
67
68
  function LogBoxInspectorStackFrames(props: Props): React.Node {
68
- const [collapsed, setCollapsed] = React.useState(() => {
69
+ const [collapsed, setCollapsed] = useState(() => {
69
70
  // Only collapse frames initially if some frames are not collapsed.
70
71
  return props.log.getAvailableStack().some(({collapse}) => !collapse);
71
72
  });
@@ -6,7 +6,6 @@
6
6
  *
7
7
  * @flow strict-local
8
8
  * @format
9
- * @oncall react_native
10
9
  */
11
10
 
12
11
  import type {
@@ -24,6 +23,7 @@ import LogBoxNotificationContainer from '../LogBox/LogBoxNotificationContainer';
24
23
  import StyleSheet from '../StyleSheet/StyleSheet';
25
24
  import {RootTagContext, createRootTag} from './RootTag';
26
25
  import * as React from 'react';
26
+ import {useRef} from 'react';
27
27
 
28
28
  const {useEffect, useState, useCallback} = React;
29
29
 
@@ -95,9 +95,9 @@ const AppContainer = ({
95
95
  WrapperComponent,
96
96
  rootViewStyle,
97
97
  }: Props): React.Node => {
98
- const appContainerRootViewRef: AppContainerRootViewRef = React.useRef(null);
99
- const innerViewRef: InspectedViewRef = React.useRef(null);
100
- const debuggingOverlayRef: DebuggingOverlayRef = React.useRef(null);
98
+ const appContainerRootViewRef: AppContainerRootViewRef = useRef(null);
99
+ const innerViewRef: InspectedViewRef = useRef(null);
100
+ const debuggingOverlayRef: DebuggingOverlayRef = useRef(null);
101
101
 
102
102
  useSubscribeToDebuggingOverlayRegistry(
103
103
  appContainerRootViewRef,
@@ -6,7 +6,6 @@
6
6
  *
7
7
  * @flow strict-local
8
8
  * @format
9
- * @oncall react_native
10
9
  */
11
10
 
12
11
  import type {Props} from './AppContainer';
@@ -9,11 +9,11 @@
9
9
  */
10
10
 
11
11
  import * as React from 'react';
12
+ import {createContext} from 'react';
12
13
 
13
14
  export opaque type RootTag = number;
14
15
 
15
- export const RootTagContext: React.Context<RootTag> =
16
- React.createContext<RootTag>(0);
16
+ export const RootTagContext: React.Context<RootTag> = createContext<RootTag>(0);
17
17
 
18
18
  if (__DEV__) {
19
19
  RootTagContext.displayName = 'RootTagContext';
@@ -51,6 +51,7 @@ export type {PublicRootInstance} from '../ReactNative/ReactFabricPublicInstance/
51
51
  export type PublicTextInstance = ReturnType<createPublicTextInstance>;
52
52
 
53
53
  // flowlint unsafe-getters-setters:off
54
+ // eslint-disable-next-line lint/no-commonjs-exports
54
55
  module.exports = {
55
56
  get BatchedBridge(): BatchedBridge {
56
57
  return require('../BatchedBridge/BatchedBridge').default;