@office-iss/react-native-win32 0.0.0-canary.296 → 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 (141) hide show
  1. package/.flowconfig +3 -1
  2. package/CHANGELOG.json +22 -1
  3. package/CHANGELOG.md +13 -4
  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/Core/Devtools/loadBundleFromServer.js +49 -7
  45. package/Libraries/Core/Devtools/loadBundleFromServer.win32.js +49 -7
  46. package/Libraries/Core/InitializeCore.js +1 -22
  47. package/Libraries/Core/ReactNativeVersion.js +3 -2
  48. package/Libraries/Debugging/DebuggingOverlay.js +6 -8
  49. package/Libraries/Debugging/DebuggingOverlayRegistry.js +0 -1
  50. package/Libraries/Debugging/useSubscribeToDebuggingOverlayRegistry.js +0 -1
  51. package/Libraries/EventEmitter/NativeEventEmitter.js +1 -1
  52. package/Libraries/Image/AssetRegistry.js +4 -10
  53. package/Libraries/Image/AssetSourceResolver.js +17 -4
  54. package/Libraries/Image/Image.android.js +112 -106
  55. package/Libraries/Image/Image.ios.js +10 -2
  56. package/Libraries/Image/Image.win32.js +11 -3
  57. package/Libraries/Image/ImageAnalyticsTagContext.js +2 -2
  58. package/Libraries/Image/RelativeImageStub.js +1 -0
  59. package/Libraries/Lists/FlatList.d.ts +9 -5
  60. package/Libraries/Lists/FlatList.js +1 -1
  61. package/Libraries/Lists/SectionListModern.js +9 -3
  62. package/Libraries/LogBox/UI/LogBoxButton.js +2 -1
  63. package/Libraries/LogBox/UI/LogBoxInspectorReactFrames.js +2 -1
  64. package/Libraries/LogBox/UI/LogBoxInspectorReactFrames.win32.js +2 -1
  65. package/Libraries/LogBox/UI/LogBoxInspectorSourceMapStatus.js +3 -2
  66. package/Libraries/LogBox/UI/LogBoxInspectorSourceMapStatus.win32.js +3 -2
  67. package/Libraries/LogBox/UI/LogBoxInspectorStackFrames.js +2 -1
  68. package/Libraries/ReactNative/AppContainer-dev.js +4 -4
  69. package/Libraries/ReactNative/AppContainer-prod.js +0 -1
  70. package/Libraries/ReactNative/RootTag.js +2 -2
  71. package/Libraries/ReactPrivate/ReactNativePrivateInterface.js +1 -0
  72. package/Libraries/Renderer/shims/ReactNativeTypes.js +21 -25
  73. package/Libraries/Renderer/shims/ReactNativeTypes.win32.js +270 -0
  74. package/Libraries/StyleSheet/StyleSheetExports.js.flow +3 -1
  75. package/Libraries/StyleSheet/StyleSheetTypes.js +4 -3
  76. package/Libraries/StyleSheet/private/_TransformStyle.js +49 -21
  77. package/Libraries/StyleSheet/processBoxShadow.js +0 -1
  78. package/Libraries/StyleSheet/processFilter.js +0 -1
  79. package/Libraries/Text/Text.d.ts +7 -0
  80. package/Libraries/Text/Text.js +255 -244
  81. package/Libraries/Text/Text.win32.js +293 -284
  82. package/Libraries/Text/TextAncestor.js +3 -2
  83. package/Libraries/Text/TextProps.js +2 -34
  84. package/Libraries/Text/TextProps.win32.js +2 -33
  85. package/Libraries/Types/ReactDevToolsTypes.js +0 -1
  86. package/Libraries/Utilities/PerformanceLoggerContext.js +2 -2
  87. package/Libraries/Utilities/PlatformTypes.js +1 -1
  88. package/Libraries/vendor/core/ErrorUtils.js +28 -4
  89. package/index.js +0 -1
  90. package/jest/mockNativeComponent.js +2 -1
  91. package/jest/renderer.js +0 -1
  92. package/jest/resolver.js +31 -0
  93. package/jest/setup.js +1 -1
  94. package/overrides.json +27 -20
  95. package/package.json +13 -13
  96. package/src/private/animated/NativeAnimatedHelper.js +6 -1
  97. package/src/private/animated/NativeAnimatedHelper.win32.js +6 -1
  98. package/src/private/animated/createAnimatedPropsHook.js +11 -4
  99. package/src/private/animated/createAnimatedPropsMemoHook.js +0 -1
  100. package/src/private/components/safeareaview/SafeAreaView_INTERNAL_DO_NOT_USE.js +0 -1
  101. package/src/private/components/scrollview/HScrollViewNativeComponents.js +0 -1
  102. package/src/private/components/scrollview/VScrollViewNativeComponents.js +0 -1
  103. package/src/private/devsupport/rndevtools/FuseboxSessionObserver.js +0 -1
  104. package/src/private/devsupport/rndevtools/ReactDevToolsSettingsManager.android.js +8 -9
  105. package/src/private/devsupport/rndevtools/ReactDevToolsSettingsManager.ios.js +12 -15
  106. package/src/private/devsupport/rndevtools/ReactDevToolsSettingsManager.win32.js +8 -9
  107. package/src/private/devsupport/rndevtools/setUpFuseboxReactDevToolsDispatcher.js +0 -1
  108. package/src/private/devsupport/rndevtools/specs/NativeReactDevToolsRuntimeSettingsModule.js +0 -1
  109. package/src/private/featureflags/ReactNativeFeatureFlags.js +39 -4
  110. package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +5 -2
  111. package/src/private/setup/setUpDefaultReactNativeEnvironment.js +44 -0
  112. package/src/private/styles/composeStyles.js +12 -5
  113. package/src/private/webapis/dom/events/Event.js +3 -0
  114. package/src/private/webapis/dom/events/EventTarget.js +3 -0
  115. package/src/private/webapis/dom/nodes/ReactNativeElement.js +6 -23
  116. package/src/private/webapis/dom/nodes/ReadOnlyNode.js +3 -1
  117. package/src/private/webapis/dom/nodes/specs/NativeDOM.js +38 -0
  118. package/src/private/webapis/dom/oldstylecollections/HTMLCollection.js +3 -0
  119. package/src/private/webapis/dom/oldstylecollections/NodeList.js +3 -0
  120. package/src/private/webapis/errors/DOMException.js +166 -0
  121. package/src/private/webapis/geometry/DOMRect.js +5 -0
  122. package/src/private/webapis/geometry/DOMRectList.js +3 -0
  123. package/src/private/webapis/geometry/DOMRectReadOnly.js +6 -0
  124. package/src/private/webapis/intersectionobserver/IntersectionObserver.js +15 -7
  125. package/src/private/webapis/intersectionobserver/IntersectionObserverEntry.js +3 -0
  126. package/src/private/webapis/intersectionobserver/internals/IntersectionObserverManager.js +80 -18
  127. package/src/private/webapis/intersectionobserver/specs/NativeIntersectionObserver.js +12 -0
  128. package/src/private/webapis/mutationobserver/MutationObserver.js +23 -33
  129. package/src/private/webapis/mutationobserver/MutationRecord.js +3 -0
  130. package/src/private/webapis/mutationobserver/internals/MutationObserverManager.js +56 -24
  131. package/src/private/webapis/mutationobserver/specs/NativeMutationObserver.js +4 -1
  132. package/src/private/webapis/performance/MemoryInfo.js +4 -1
  133. package/src/private/webapis/performance/Performance.js +19 -8
  134. package/src/private/webapis/performance/PerformanceEntry.js +4 -0
  135. package/src/private/webapis/performance/ReactNativeStartupTiming.js +4 -1
  136. package/src/private/webapis/performance/internals/RawPerformanceEntry.js +2 -0
  137. package/src/private/webapis/structuredClone/structuredClone.js +233 -0
  138. package/src/private/webapis/webidl/PlatformObjects.js +59 -0
  139. package/src/types/globals.d.ts +42 -0
  140. package/src-win/Libraries/Text/Text.d.ts +7 -0
  141. package/types/index.d.ts +1 -1
@@ -39,23 +39,24 @@ export type {ProgressBarAndroidProps};
39
39
  * },
40
40
  * ```
41
41
  */
42
- const ProgressBarAndroidWithForwardedRef: component(
42
+ const ProgressBarAndroid: component(
43
43
  ref?: React.RefSetter<
44
44
  React.ElementRef<typeof ProgressBarAndroidNativeComponent>,
45
45
  >,
46
46
  ...props: ProgressBarAndroidProps
47
- ) = React.forwardRef(function ProgressBarAndroid(
48
- {
49
- // $FlowFixMe[incompatible-type]
50
- styleAttr = 'Normal',
51
- indeterminate = true,
52
- animating = true,
53
- ...restProps
54
- }: ProgressBarAndroidProps,
55
- forwardedRef: ?React.RefSetter<
47
+ ) = function ProgressBarAndroid({
48
+ ref: forwardedRef,
49
+ // $FlowFixMe[incompatible-type]
50
+ styleAttr = 'Normal',
51
+ indeterminate = true,
52
+ animating = true,
53
+ ...restProps
54
+ }: {
55
+ ref?: React.RefSetter<
56
56
  React.ElementRef<typeof ProgressBarAndroidNativeComponent>,
57
57
  >,
58
- ) {
58
+ ...ProgressBarAndroidProps,
59
+ }) {
59
60
  return (
60
61
  <ProgressBarAndroidNativeComponent
61
62
  styleAttr={styleAttr}
@@ -65,6 +66,6 @@ const ProgressBarAndroidWithForwardedRef: component(
65
66
  ref={forwardedRef}
66
67
  />
67
68
  );
68
- });
69
+ };
69
70
 
70
- export default ProgressBarAndroidWithForwardedRef;
71
+ export default ProgressBarAndroid;
@@ -17,11 +17,23 @@ import Platform from '../../Utilities/Platform';
17
17
 
18
18
  export type {ProgressBarAndroidProps};
19
19
 
20
+ // A utility type to preserve the semantics of the union uses in the definition
21
+ // of ProgressBarAndroidProps. TS's Omit does not distribute over unions, so
22
+ // we define our own version which does. This does not affect Flow.
23
+ // $FlowExpectedError[unclear-type]
24
+ type Omit<T, K> = T extends any ? Pick<T, Exclude<$Keys<T>, K>> : T;
25
+
26
+ /**
27
+ * ProgressBarAndroid has been extracted from react-native core and will be removed in a future release.
28
+ * It can now be installed and imported from `@react-native-community/progress-bar-android` instead of 'react-native'.
29
+ * @see https://github.com/react-native-community/progress-bar-android
30
+ * @deprecated
31
+ */
20
32
  let ProgressBarAndroid: component(
21
33
  ref?: React.RefSetter<
22
34
  React.ElementRef<ProgressBarAndroidNativeComponentType>,
23
35
  >,
24
- ...props: ProgressBarAndroidProps
36
+ ...props: Omit<ProgressBarAndroidProps, empty>
25
37
  );
26
38
 
27
39
  if (Platform.OS === 'android') {
@@ -17,28 +17,25 @@ import type {ViewProps} from '../View/ViewPropTypes';
17
17
  * `indeterminate` can only be false if `styleAttr` is Horizontal, and requires a
18
18
  * `progress` value.
19
19
  */
20
- type ProgressBarAndroidStyleAttrProp =
21
- | {
22
- styleAttr: 'Horizontal',
23
- indeterminate: false,
24
- progress: number,
25
- }
26
- | {
27
- styleAttr:
28
- | 'Horizontal'
29
- | 'Normal'
30
- | 'Small'
31
- | 'Large'
32
- | 'Inverse'
33
- | 'SmallInverse'
34
- | 'LargeInverse',
35
- indeterminate: true,
36
- };
20
+ type DeterminateProgressBarAndroidStyleAttrProp = {
21
+ styleAttr: 'Horizontal',
22
+ indeterminate: false,
23
+ progress: number,
24
+ };
37
25
 
38
- export type ProgressBarAndroidProps = $ReadOnly<{
39
- ...ViewProps,
40
- ...ProgressBarAndroidStyleAttrProp,
26
+ type IndeterminateProgressBarAndroidStyleAttrProp = {
27
+ styleAttr:
28
+ | 'Horizontal'
29
+ | 'Normal'
30
+ | 'Small'
31
+ | 'Large'
32
+ | 'Inverse'
33
+ | 'SmallInverse'
34
+ | 'LargeInverse',
35
+ indeterminate: true,
36
+ };
41
37
 
38
+ type ProgressBarAndroidBaseProps = $ReadOnly<{
42
39
  /**
43
40
  * Whether to show the ProgressBar (true, the default) or hide it (false).
44
41
  */
@@ -52,3 +49,15 @@ export type ProgressBarAndroidProps = $ReadOnly<{
52
49
  */
53
50
  testID?: ?string,
54
51
  }>;
52
+
53
+ export type ProgressBarAndroidProps =
54
+ | $ReadOnly<{
55
+ ...ViewProps,
56
+ ...ProgressBarAndroidBaseProps,
57
+ ...DeterminateProgressBarAndroidStyleAttrProp,
58
+ }>
59
+ | $ReadOnly<{
60
+ ...ViewProps,
61
+ ...ProgressBarAndroidBaseProps,
62
+ ...IndeterminateProgressBarAndroidStyleAttrProp,
63
+ }>;
@@ -565,16 +565,20 @@ export interface ScrollViewPropsAndroid {
565
565
  nestedScrollEnabled?: boolean | undefined;
566
566
 
567
567
  /**
568
- * Fades out the edges of the scroll content.
568
+ * Controls the fading effect at the edges of the scroll content.
569
569
  *
570
- * If the value is greater than 0, the fading edges will be set accordingly
571
- * to the current scroll direction and position,
572
- * indicating if there is more content to show.
570
+ * A value greater than 0 will apply the fading effect, indicating more content is available
571
+ * to scroll.
572
+ *
573
+ * You can specify a single number to apply the same fading length to both edges.
574
+ * Alternatively, use an object with `start` and `end` properties to set different
575
+ * fading lengths for the start and end of the scroll content.
573
576
  *
574
577
  * The default value is 0.
578
+ *
575
579
  * @platform android
576
580
  */
577
- fadingEdgeLength?: number | undefined;
581
+ fadingEdgeLength?: number | {start: number; end: number} | undefined;
578
582
 
579
583
  /**
580
584
  * Causes the scrollbars not to turn transparent when they are not in use. The default value is false.
@@ -52,6 +52,7 @@ import invariant from 'invariant';
52
52
  import memoize from 'memoize-one';
53
53
  import nullthrows from 'nullthrows';
54
54
  import * as React from 'react';
55
+ import {cloneElement} from 'react';
55
56
 
56
57
  /*
57
58
  * iOS scroll event timing nuances:
@@ -372,17 +373,20 @@ export type ScrollViewPropsAndroid = $ReadOnly<{
372
373
  */
373
374
  persistentScrollbar?: ?boolean,
374
375
  /**
375
- * Fades out the edges of the scroll content.
376
+ * Controls the fading effect at the edges of the scroll content.
376
377
  *
377
- * If the value is greater than 0, the fading edges will be set accordingly
378
- * to the current scroll direction and position,
379
- * indicating if there is more content to show.
378
+ * A value greater than 0 will apply the fading effect, indicating more content is available
379
+ * to scroll.
380
+ *
381
+ * You can specify a single number to apply the same fading length to both edges.
382
+ * Alternatively, use an object with `start` and `end` properties to set different
383
+ * fading lengths for the start and end of the scroll content.
380
384
  *
381
385
  * The default value is 0.
382
386
  *
383
387
  * @platform android
384
388
  */
385
- fadingEdgeLength?: ?number,
389
+ fadingEdgeLength?: ?number | {start: number, end: number},
386
390
  }>;
387
391
 
388
392
  type StickyHeaderComponentType = component(
@@ -1827,7 +1831,7 @@ class ScrollView extends React.Component<ScrollViewProps, ScrollViewState> {
1827
1831
  // however, the ScrollView still needs the baseStyle to be scrollable
1828
1832
  const {outer, inner} = splitLayoutProps(flattenStyle(props.style));
1829
1833
  // $FlowFixMe[incompatible-call]
1830
- return React.cloneElement(
1834
+ return cloneElement(
1831
1835
  refreshControl,
1832
1836
  {style: StyleSheet.compose(baseStyle, outer)},
1833
1837
  <NativeScrollView
@@ -1907,23 +1911,25 @@ function createRefForwarder<TNativeInstance, TPublicInstance>(
1907
1911
  return state;
1908
1912
  }
1909
1913
 
1910
- // TODO: After upgrading to React 19, remove `forwardRef` from this component.
1911
1914
  // NOTE: This wrapper component is necessary because `ScrollView` is a class
1912
1915
  // component and we need to map `ref` to a differently named prop. This can be
1913
1916
  // removed when `ScrollView` is a functional component.
1914
1917
  const ScrollViewWrapper: component(
1915
1918
  ref?: React.RefSetter<PublicScrollViewInstance>,
1916
1919
  ...props: ScrollViewProps
1917
- ) = React.forwardRef(function Wrapper(
1918
- props: ScrollViewProps,
1919
- ref: ?React.RefSetter<PublicScrollViewInstance>,
1920
- ): React.Node {
1920
+ ) = function Wrapper({
1921
+ ref,
1922
+ ...props
1923
+ }: {
1924
+ ref?: React.RefSetter<PublicScrollViewInstance>,
1925
+ ...ScrollViewProps,
1926
+ }): React.Node {
1921
1927
  return ref == null ? (
1922
1928
  <ScrollView {...props} />
1923
1929
  ) : (
1924
1930
  <ScrollView {...props} scrollViewRef={ref} />
1925
1931
  );
1926
- });
1932
+ };
1927
1933
  ScrollViewWrapper.displayName = 'ScrollView';
1928
1934
  // $FlowExpectedError[prop-missing]
1929
1935
  ScrollViewWrapper.Context = ScrollViewContext;
@@ -9,10 +9,11 @@
9
9
  */
10
10
 
11
11
  import * as React from 'react';
12
+ import {createContext} from 'react';
12
13
 
13
14
  type Value = {horizontal: boolean} | null;
14
15
 
15
- const ScrollViewContext: React.Context<Value> = React.createContext(null);
16
+ const ScrollViewContext: React.Context<Value> = createContext(null);
16
17
  if (__DEV__) {
17
18
  ScrollViewContext.displayName = 'ScrollViewContext';
18
19
  }
@@ -42,7 +42,7 @@ export type ScrollViewNativeProps = $ReadOnly<{
42
42
  directionalLockEnabled?: ?boolean,
43
43
  disableIntervalMomentum?: ?boolean,
44
44
  endFillColor?: ?ColorValue,
45
- fadingEdgeLength?: ?number,
45
+ fadingEdgeLength?: ?number | {start: number, end: number},
46
46
  indicatorStyle?: ?('default' | 'black' | 'white'),
47
47
  isInvertedVirtualizedList?: ?boolean,
48
48
  keyboardDismissMode?: ?('none' | 'on-drag' | 'interactive'),
@@ -16,7 +16,14 @@ import StyleSheet from '../../StyleSheet/StyleSheet';
16
16
  import Platform from '../../Utilities/Platform';
17
17
  import useMergeRefs from '../../Utilities/useMergeRefs';
18
18
  import * as React from 'react';
19
- import {useCallback, useEffect, useMemo, useRef, useState} from 'react';
19
+ import {
20
+ cloneElement,
21
+ useCallback,
22
+ useEffect,
23
+ useMemo,
24
+ useRef,
25
+ useState,
26
+ } from 'react';
20
27
 
21
28
  export type ScrollViewStickyHeaderProps = $ReadOnly<{
22
29
  children?: React.Node,
@@ -36,10 +43,16 @@ interface Instance extends React.ElementRef<typeof Animated.View> {
36
43
  +setNextHeaderY: number => void;
37
44
  }
38
45
 
39
- const ScrollViewStickyHeaderWithForwardedRef: component(
46
+ const ScrollViewStickyHeader: component(
40
47
  ref: React.RefSetter<Instance>,
41
48
  ...props: ScrollViewStickyHeaderProps
42
- ) = React.forwardRef(function ScrollViewStickyHeader(props, forwardedRef) {
49
+ ) = function ScrollViewStickyHeader({
50
+ ref: forwardedRef,
51
+ ...props
52
+ }: {
53
+ ref?: React.RefSetter<Instance>,
54
+ ...ScrollViewStickyHeaderProps,
55
+ }) {
43
56
  const {
44
57
  inverted,
45
58
  scrollViewHeight,
@@ -289,13 +302,13 @@ const ScrollViewStickyHeaderWithForwardedRef: component(
289
302
  passthroughAnimatedPropExplicitValues={
290
303
  passthroughAnimatedPropExplicitValues
291
304
  }>
292
- {React.cloneElement(child, {
305
+ {cloneElement(child, {
293
306
  style: styles.fill, // We transfer the child style to the wrapper.
294
307
  onLayout: undefined, // we call this manually through our this._onLayout
295
308
  })}
296
309
  </Animated.View>
297
310
  );
298
- });
311
+ };
299
312
 
300
313
  const styles = StyleSheet.create({
301
314
  header: {
@@ -306,4 +319,4 @@ const styles = StyleSheet.create({
306
319
  },
307
320
  });
308
321
 
309
- export default ScrollViewStickyHeaderWithForwardedRef;
322
+ export default ScrollViewStickyHeader;
@@ -165,7 +165,13 @@ type SwitchRef = React.ElementRef<
165
165
  const Switch: component(
166
166
  ref?: React.RefSetter<SwitchRef>,
167
167
  ...props: SwitchProps
168
- ) = React.forwardRef(function Switch(props, forwardedRef): React.Node {
168
+ ) = function Switch({
169
+ ref: forwardedRef,
170
+ ...props
171
+ }: {
172
+ ref?: React.RefSetter<SwitchRef>,
173
+ ...SwitchProps,
174
+ }): React.Node {
169
175
  const {
170
176
  disabled,
171
177
  ios_backgroundColor,
@@ -285,6 +291,6 @@ const Switch: component(
285
291
  />
286
292
  );
287
293
  }
288
- });
294
+ };
289
295
 
290
296
  export default Switch;
@@ -10,11 +10,7 @@
10
10
 
11
11
  import type {HostComponent} from '../../../src/private/types/HostComponent';
12
12
  import type {PartialViewConfig} from '../../Renderer/shims/ReactNativeTypes';
13
- import type {
14
- ColorValue,
15
- TextStyleProp,
16
- ViewStyleProp,
17
- } from '../../StyleSheet/StyleSheet';
13
+ import type {ColorValue, TextStyleProp} from '../../StyleSheet/StyleSheet';
18
14
  import type {
19
15
  BubblingEventHandler,
20
16
  DirectEventHandler,
@@ -16,11 +16,7 @@ import type {
16
16
  } from '../../Types/CoreEventTypes';
17
17
  import type {ViewProps} from '../View/ViewPropTypes';
18
18
 
19
- import {
20
- type ColorValue,
21
- type TextStyleProp,
22
- type ViewStyleProp,
23
- } from '../../StyleSheet/StyleSheet';
19
+ import {type ColorValue, type TextStyleProp} from '../../StyleSheet/StyleSheet';
24
20
  import * as React from 'react';
25
21
 
26
22
  /**
@@ -16,11 +16,7 @@ import type {
16
16
  } from '../../Types/CoreEventTypes';
17
17
  import type {ViewProps} from '../View/ViewPropTypes';
18
18
 
19
- import {
20
- type ColorValue,
21
- type TextStyleProp,
22
- type ViewStyleProp,
23
- } from '../../StyleSheet/StyleSheet';
19
+ import {type ColorValue, type TextStyleProp} from '../../StyleSheet/StyleSheet';
24
20
  import * as React from 'react';
25
21
 
26
22
  /**
@@ -60,7 +60,7 @@ import TextInputState from './TextInputState';
60
60
  import invariant from 'invariant';
61
61
  import nullthrows from 'nullthrows';
62
62
  import * as React from 'react';
63
- import {useCallback, useLayoutEffect, useRef, useState} from 'react';
63
+ import {useCallback, useLayoutEffect, useMemo, useRef, useState} from 'react';
64
64
 
65
65
  let AndroidTextInput;
66
66
  let AndroidTextInputCommands;
@@ -578,7 +578,7 @@ function InternalTextInput(props: TextInputProps): React.Node {
578
578
  rejectResponderTermination,
579
579
  } = props;
580
580
 
581
- const config = React.useMemo(
581
+ const config = useMemo(
582
582
  () => ({
583
583
  hitSlop,
584
584
  onPress: (event: GestureResponderEvent) => {
@@ -871,27 +871,28 @@ const autoCompleteWebToTextContentTypeMap = {
871
871
  username: 'username',
872
872
  };
873
873
 
874
- const ExportedForwardRef: component(
874
+ const TextInput: component(
875
875
  ref?: React.RefSetter<TextInputInstance>,
876
876
  ...props: React.ElementConfig<typeof InternalTextInput>
877
- ) = React.forwardRef(function TextInput(
878
- {
879
- allowFontScaling = true,
880
- rejectResponderTermination = true,
881
- underlineColorAndroid = 'transparent',
882
- autoComplete,
883
- textContentType,
884
- readOnly,
885
- editable,
886
- enterKeyHint,
887
- returnKeyType,
888
- inputMode,
889
- showSoftInputOnFocus,
890
- keyboardType,
891
- ...restProps
892
- },
893
- forwardedRef: React.RefSetter<TextInputInstance>,
894
- ) {
877
+ ) = function TextInput({
878
+ ref: forwardedRef,
879
+ allowFontScaling = true,
880
+ rejectResponderTermination = true,
881
+ underlineColorAndroid = 'transparent',
882
+ autoComplete,
883
+ textContentType,
884
+ readOnly,
885
+ editable,
886
+ enterKeyHint,
887
+ returnKeyType,
888
+ inputMode,
889
+ showSoftInputOnFocus,
890
+ keyboardType,
891
+ ...restProps
892
+ }: {
893
+ ref?: React.RefSetter<TextInputInstance>,
894
+ ...React.ElementConfig<typeof InternalTextInput>,
895
+ }) {
895
896
  return (
896
897
  <InternalTextInput
897
898
  allowFontScaling={allowFontScaling}
@@ -930,12 +931,12 @@ const ExportedForwardRef: component(
930
931
  forwardedRef={forwardedRef}
931
932
  />
932
933
  );
933
- });
934
+ };
934
935
 
935
- ExportedForwardRef.displayName = 'TextInput';
936
+ TextInput.displayName = 'TextInput';
936
937
 
937
938
  // $FlowFixMe[prop-missing]
938
- ExportedForwardRef.State = {
939
+ TextInput.State = {
939
940
  currentlyFocusedInput: TextInputState.currentlyFocusedInput,
940
941
 
941
942
  currentlyFocusedField: TextInputState.currentlyFocusedField,
@@ -964,4 +965,4 @@ const verticalAlignToTextAlignVerticalMap = {
964
965
  };
965
966
 
966
967
  // $FlowFixMe[unclear-type] Unclear type. Using `any` type is not safe.
967
- export default ExportedForwardRef as any as TextInputType;
968
+ export default TextInput as any as TextInputType;
@@ -61,7 +61,7 @@ import TextInputState from './TextInputState';
61
61
  import invariant from 'invariant';
62
62
  import nullthrows from 'nullthrows';
63
63
  import * as React from 'react';
64
- import {useCallback, useLayoutEffect, useRef, useState} from 'react';
64
+ import {useCallback, useLayoutEffect, useMemo, useRef, useState} from 'react';
65
65
 
66
66
  let AndroidTextInput;
67
67
  let AndroidTextInputCommands;
@@ -463,6 +463,7 @@ function InternalTextInput(props: TextInputProps): React.Node {
463
463
  */
464
464
  if (instance != null) {
465
465
  // $FlowFixMe[prop-missing] - See the explanation above.
466
+ // $FlowFixMe[unsafe-object-assign]
466
467
  Object.assign(instance, {
467
468
  clear(): void {
468
469
  if (inputRef.current != null) {
@@ -604,7 +605,7 @@ function InternalTextInput(props: TextInputProps): React.Node {
604
605
  rejectResponderTermination,
605
606
  } = props;
606
607
 
607
- const config = React.useMemo(
608
+ const config = useMemo(
608
609
  () => ({
609
610
  hitSlop,
610
611
  onPress: (event: GestureResponderEvent) => {
@@ -981,27 +982,28 @@ const autoCompleteWebToTextContentTypeMap = {
981
982
  username: 'username',
982
983
  };
983
984
 
984
- const ExportedForwardRef: component(
985
+ const TextInput: component(
985
986
  ref?: React.RefSetter<TextInputInstance>,
986
987
  ...props: React.ElementConfig<typeof InternalTextInput>
987
- ) = React.forwardRef(function TextInput(
988
- {
989
- allowFontScaling = true,
990
- rejectResponderTermination = true,
991
- underlineColorAndroid = 'transparent',
992
- autoComplete,
993
- textContentType,
994
- readOnly,
995
- editable,
996
- enterKeyHint,
997
- returnKeyType,
998
- inputMode,
999
- showSoftInputOnFocus,
1000
- keyboardType,
1001
- ...restProps
1002
- },
1003
- forwardedRef: React.RefSetter<TextInputInstance>,
1004
- ) {
988
+ ) = function TextInput({
989
+ ref: forwardedRef,
990
+ allowFontScaling = true,
991
+ rejectResponderTermination = true,
992
+ underlineColorAndroid = 'transparent',
993
+ autoComplete,
994
+ textContentType,
995
+ readOnly,
996
+ editable,
997
+ enterKeyHint,
998
+ returnKeyType,
999
+ inputMode,
1000
+ showSoftInputOnFocus,
1001
+ keyboardType,
1002
+ ...restProps
1003
+ }: {
1004
+ ref?: React.RefSetter<TextInputInstance>,
1005
+ ...React.ElementConfig<typeof InternalTextInput>,
1006
+ }) {
1005
1007
  return (
1006
1008
  <InternalTextInput
1007
1009
  allowFontScaling={allowFontScaling}
@@ -1039,12 +1041,12 @@ const ExportedForwardRef: component(
1039
1041
  forwardedRef={forwardedRef}
1040
1042
  />
1041
1043
  );
1042
- });
1044
+ };
1043
1045
 
1044
- ExportedForwardRef.displayName = 'TextInput';
1046
+ TextInput.displayName = 'TextInput';
1045
1047
 
1046
1048
  // $FlowFixMe[prop-missing]
1047
- ExportedForwardRef.State = {
1049
+ TextInput.State = {
1048
1050
  currentlyFocusedInput: TextInputState.currentlyFocusedInput,
1049
1051
 
1050
1052
  currentlyFocusedField: TextInputState.currentlyFocusedField,
@@ -1073,4 +1075,4 @@ const verticalAlignToTextAlignVerticalMap = {
1073
1075
  };
1074
1076
 
1075
1077
  // $FlowFixMe[unclear-type] Unclear type. Using `any` type is not safe.
1076
- export default ExportedForwardRef as any as TextInputType;
1078
+ export default TextInput as any as TextInputType;
@@ -221,9 +221,15 @@ class TouchableBounce extends React.Component<
221
221
  }
222
222
  }
223
223
 
224
- export default (React.forwardRef((props, hostRef: React.RefSetter<mixed>) => (
225
- <TouchableBounce {...props} hostRef={hostRef} />
226
- )): component(
224
+ export default (function TouchableBounceWrapper({
225
+ ref: hostRef,
226
+ ...props
227
+ }: {
228
+ ref: React.RefSetter<mixed>,
229
+ ...$ReadOnly<Omit<TouchableBounceProps, 'hostRef'>>,
230
+ }) {
231
+ return <TouchableBounce {...props} hostRef={hostRef} />;
232
+ } as component(
227
233
  ref: React.RefSetter<mixed>,
228
234
  ...props: $ReadOnly<Omit<TouchableBounceProps, 'hostRef'>>
229
235
  ));
@@ -19,6 +19,7 @@ import {PressabilityDebugView} from '../../Pressability/PressabilityDebug';
19
19
  import StyleSheet, {type ViewStyleProp} from '../../StyleSheet/StyleSheet';
20
20
  import Platform from '../../Utilities/Platform';
21
21
  import * as React from 'react';
22
+ import {cloneElement} from 'react';
22
23
 
23
24
  type AndroidProps = $ReadOnly<{
24
25
  nextFocusDown?: ?number,
@@ -371,7 +372,7 @@ class TouchableHighlightImpl extends React.Component<
371
372
  testID={this.props.testID}
372
373
  ref={this.props.hostRef}
373
374
  {...eventHandlersWithoutBlurAndFocus}>
374
- {React.cloneElement(child, {
375
+ {cloneElement(child, {
375
376
  style: StyleSheet.compose(
376
377
  child.props.style,
377
378
  this.state.extraStyles?.child,
@@ -408,9 +409,13 @@ class TouchableHighlightImpl extends React.Component<
408
409
  const TouchableHighlight: component(
409
410
  ref?: React.RefSetter<React.ElementRef<typeof View>>,
410
411
  ...props: $ReadOnly<Omit<TouchableHighlightProps, 'hostRef'>>
411
- ) = React.forwardRef((props, hostRef) => (
412
- <TouchableHighlightImpl {...props} hostRef={hostRef} />
413
- ));
412
+ ) = ({
413
+ ref: hostRef,
414
+ ...props
415
+ }: {
416
+ ref?: React.RefSetter<React.ElementRef<typeof View>>,
417
+ ...$ReadOnly<Omit<TouchableHighlightProps, 'hostRef'>>,
418
+ }) => <TouchableHighlightImpl {...props} hostRef={hostRef} />;
414
419
 
415
420
  TouchableHighlight.displayName = 'TouchableHighlight';
416
421
 
@@ -22,6 +22,7 @@ import Platform from '../../Utilities/Platform';
22
22
  import {Commands} from '../View/ViewNativeComponent';
23
23
  import invariant from 'invariant';
24
24
  import * as React from 'react';
25
+ import {cloneElement} from 'react';
25
26
 
26
27
  type TVProps = {
27
28
  /**
@@ -334,7 +335,7 @@ class TouchableNativeFeedback extends React.Component<
334
335
 
335
336
  const accessibilityLabel =
336
337
  this.props['aria-label'] ?? this.props.accessibilityLabel;
337
- return React.cloneElement(
338
+ return cloneElement(
338
339
  element,
339
340
  {
340
341
  ...eventHandlersWithoutBlurAndFocus,
@@ -13,12 +13,14 @@ import type {TouchableWithoutFeedbackProps} from './TouchableWithoutFeedback';
13
13
  import Pressability, {
14
14
  type PressabilityConfig,
15
15
  } from '../../Pressability/Pressability';
16
+ import {PressabilityDebugView} from '../../Pressability/PressabilityDebug';
16
17
  import {findHostInstance_DEPRECATED} from '../../ReactNative/RendererProxy';
17
18
  import processColor from '../../StyleSheet/processColor';
18
19
  import Platform from '../../Utilities/Platform';
19
20
  import {Commands} from '../View/ViewNativeComponent';
20
21
  import invariant from 'invariant';
21
22
  import * as React from 'react';
23
+ import {cloneElement} from 'react';
22
24
 
23
25
  type TVProps = {
24
26
  /**
@@ -379,9 +379,13 @@ class TouchableOpacity extends React.Component<
379
379
  const Touchable: component(
380
380
  ref?: React.RefSetter<React.ElementRef<typeof Animated.View>>,
381
381
  ...props: TouchableOpacityProps
382
- ) = React.forwardRef((props, ref) => (
383
- <TouchableOpacity {...props} hostRef={ref} />
384
- ));
382
+ ) = ({
383
+ ref,
384
+ ...props
385
+ }: {
386
+ ref?: React.RefSetter<React.ElementRef<typeof Animated.View>>,
387
+ ...TouchableOpacityProps,
388
+ }) => <TouchableOpacity {...props} hostRef={ref} />;
385
389
 
386
390
  Touchable.displayName = 'TouchableOpacity';
387
391