@office-iss/react-native-win32 0.0.0-canary.270 → 0.0.0-canary.271

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 (96) hide show
  1. package/CHANGELOG.json +16 -1
  2. package/CHANGELOG.md +12 -4
  3. package/Libraries/Animated/animations/Animation.js +63 -24
  4. package/Libraries/Animated/animations/DecayAnimation.js +26 -38
  5. package/Libraries/Animated/animations/SpringAnimation.js +33 -39
  6. package/Libraries/Animated/animations/TimingAnimation.js +34 -42
  7. package/Libraries/Animated/createAnimatedComponent.js +46 -32
  8. package/Libraries/Animated/nodes/AnimatedProps.js +16 -10
  9. package/Libraries/Animated/nodes/AnimatedStyle.js +4 -0
  10. package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.d.ts +19 -3
  11. package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.js +61 -3
  12. package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.win32.js +61 -3
  13. package/Libraries/Components/Button.js +6 -4
  14. package/Libraries/Components/Button.win32.js +9 -4
  15. package/Libraries/Components/ScrollView/ScrollView.js +5 -5
  16. package/Libraries/Components/Switch/Switch.js +8 -6
  17. package/Libraries/Components/TextInput/TextInput.d.ts +4 -4
  18. package/Libraries/Components/TextInput/TextInput.flow.js +7 -10
  19. package/Libraries/Components/TextInput/TextInput.js +7 -7
  20. package/Libraries/Components/TextInput/TextInput.win32.js +7 -7
  21. package/Libraries/Components/TextInput/TextInputState.js +11 -13
  22. package/Libraries/Components/TextInput/TextInputState.win32.js +13 -16
  23. package/Libraries/Components/View/ReactNativeStyleAttributes.js +1 -0
  24. package/Libraries/Components/View/ViewNativeComponent.js +3 -10
  25. package/Libraries/Core/ReactNativeVersion.js +1 -1
  26. package/Libraries/Core/setUpBatchedBridge.js +1 -10
  27. package/Libraries/Core/setUpReactDevTools.js +3 -3
  28. package/Libraries/Core/setUpSegmentFetcher.js +1 -0
  29. package/Libraries/Core/setUpTimers.js +8 -8
  30. package/Libraries/Image/ImageBackground.js +2 -5
  31. package/Libraries/Image/ImageProps.js +1 -1
  32. package/Libraries/Image/ImageViewNativeComponent.js +2 -2
  33. package/Libraries/Inspector/ReactDevToolsOverlay.js +0 -1
  34. package/Libraries/Inspector/getInspectorDataForViewAtPoint.js +3 -5
  35. package/Libraries/JSInspector/NetworkAgent.js +1 -1
  36. package/Libraries/Lists/FlatList.d.ts +1 -2
  37. package/Libraries/Lists/__flowtests__/FlatList-flowtest.js +2 -2
  38. package/Libraries/Lists/__flowtests__/SectionList-flowtest.js +1 -1
  39. package/Libraries/LogBox/Data/LogBoxData.js +1 -1
  40. package/Libraries/LogBox/UI/LogBoxInspectorStackFrames.js +1 -1
  41. package/Libraries/LogBox/UI/LogBoxMessage.js +2 -2
  42. package/Libraries/NativeComponent/BaseViewConfig.android.js +1 -0
  43. package/Libraries/NativeComponent/BaseViewConfig.ios.js +1 -0
  44. package/Libraries/NativeComponent/BaseViewConfig.win32.js +1 -0
  45. package/Libraries/Network/XMLHttpRequest.js +26 -1
  46. package/Libraries/Pressability/HoverState.js +2 -0
  47. package/Libraries/Pressability/HoverState.win32.js +2 -0
  48. package/Libraries/Pressability/Pressability.js +2 -3
  49. package/Libraries/Pressability/Pressability.win32.js +2 -3
  50. package/Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricHostComponent.js +2 -3
  51. package/Libraries/ReactNative/RendererImplementation.js +4 -3
  52. package/Libraries/Renderer/shims/ReactNativeTypes.js +13 -18
  53. package/Libraries/StyleSheet/StyleSheetTypes.d.ts +1 -0
  54. package/Libraries/StyleSheet/StyleSheetTypes.js +13 -0
  55. package/Libraries/StyleSheet/processTransform.js +3 -34
  56. package/Libraries/Text/Text.js +251 -249
  57. package/Libraries/Text/Text.win32.js +285 -295
  58. package/Libraries/Types/CoreEventTypes.d.ts +3 -10
  59. package/Libraries/Types/CoreEventTypes.js +4 -6
  60. package/Libraries/Types/CoreEventTypes.win32.js +4 -6
  61. package/Libraries/Utilities/Platform.flow.js +2 -2
  62. package/Libraries/Utilities/Platform.flow.win32.js +2 -2
  63. package/Libraries/__flowtests__/ReactNativeTypes-flowtest.js +5 -4
  64. package/index.js +5 -2
  65. package/index.win32.js +5 -2
  66. package/jest/setup.js +30 -0
  67. package/overrides.json +18 -17
  68. package/package.json +13 -13
  69. package/src/private/animated/NativeAnimatedHelper.js +2 -4
  70. package/src/private/animated/NativeAnimatedHelper.win32.js +2 -3
  71. package/src/private/components/HScrollViewNativeComponents.js +4 -5
  72. package/src/private/{fusebox → debugging}/setUpFuseboxReactDevToolsDispatcher.js +6 -0
  73. package/src/private/featureflags/ReactNativeFeatureFlags.js +14 -23
  74. package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +2 -5
  75. package/src/private/specs/modules/NativeAccessibilityInfo.js +3 -0
  76. package/src/private/specs/modules/NativeAccessibilityInfoWin32.js +3 -0
  77. package/src/private/specs/modules/NativeAccessibilityManager.js +4 -0
  78. package/src/private/webapis/dom/nodes/ReactNativeElement.js +2 -3
  79. package/src/private/webapis/performance/EventTiming.js +13 -8
  80. package/src/private/webapis/performance/Performance.js +30 -40
  81. package/src/private/webapis/performance/PerformanceEntry.js +2 -5
  82. package/src/private/webapis/performance/PerformanceObserver.js +20 -32
  83. package/src/private/webapis/performance/RawPerformanceEntry.js +1 -1
  84. package/src/private/webapis/performance/UserTiming.js +6 -2
  85. package/src/private/webapis/performance/Utilities.js +0 -7
  86. package/src/private/webapis/performance/specs/NativePerformance.js +53 -0
  87. package/src/private/webapis/performance/specs/__mocks__/NativePerformanceMock.js +247 -0
  88. package/src-win/Libraries/Components/AccessibilityInfo/AccessibilityInfo.d.ts +19 -3
  89. package/types/public/ReactNativeTypes.d.ts +4 -4
  90. package/src/private/webapis/performance/specs/NativePerformanceObserver.js +0 -69
  91. package/src/private/webapis/performance/specs/__mocks__/NativePerformance.js +0 -69
  92. package/src/private/webapis/performance/specs/__mocks__/NativePerformanceObserver.js +0 -154
  93. /package/src/private/{fusebox → debugging}/FuseboxSessionObserver.js +0 -0
  94. /package/src/private/{reactdevtools → debugging}/ReactDevToolsSettingsManager.android.js +0 -0
  95. /package/src/private/{reactdevtools → debugging}/ReactDevToolsSettingsManager.ios.js +0 -0
  96. /package/src/private/{reactdevtools → debugging}/ReactDevToolsSettingsManager.win32.js +0 -0
@@ -130,12 +130,14 @@ const returnsTrue = () => true;
130
130
  ```
131
131
  */
132
132
 
133
- const SwitchWithForwardedRef: React.AbstractComponent<
134
- Props,
135
- React.ElementRef<
136
- typeof SwitchNativeComponent | typeof AndroidSwitchNativeComponent,
137
- >,
138
- > = React.forwardRef(function Switch(props, forwardedRef): React.Node {
133
+ type SwitchRef = React.ElementRef<
134
+ typeof SwitchNativeComponent | typeof AndroidSwitchNativeComponent,
135
+ >;
136
+
137
+ const SwitchWithForwardedRef: component(
138
+ ref: React.RefSetter<SwitchRef>,
139
+ ...props: Props
140
+ ) = React.forwardRef(function Switch(props, forwardedRef): React.Node {
139
141
  const {
140
142
  disabled,
141
143
  ios_backgroundColor,
@@ -11,7 +11,7 @@ import type * as React from 'react';
11
11
  import {Constructor} from '../../../types/private/Utilities';
12
12
  import {TimerMixin} from '../../../types/private/TimerMixin';
13
13
  import {
14
- HostComponent,
14
+ HostInstance,
15
15
  NativeMethods,
16
16
  } from '../../../types/public/ReactNativeTypes';
17
17
  import {ColorValue, StyleProp} from '../../StyleSheet/StyleSheet';
@@ -956,21 +956,21 @@ interface TextInputState {
956
956
  * Returns the ref of the currently focused text field, if one exists
957
957
  * If no text field is focused it returns null
958
958
  */
959
- currentlyFocusedInput(): React.ElementRef<HostComponent<unknown>>;
959
+ currentlyFocusedInput(): HostInstance;
960
960
 
961
961
  /**
962
962
  * @param textField ref of the text field to focus
963
963
  * Focuses the specified text field
964
964
  * noop if the text field was already focused
965
965
  */
966
- focusTextInput(textField?: React.ElementRef<HostComponent<unknown>>): void;
966
+ focusTextInput(textField?: HostInstance): void;
967
967
 
968
968
  /**
969
969
  * @param textField ref of the text field to focus
970
970
  * Unfocuses the specified text field
971
971
  * noop if it wasn't focused
972
972
  */
973
- blurTextInput(textField?: React.ElementRef<HostComponent<unknown>>): void;
973
+ blurTextInput(textField?: HostInstance): void;
974
974
  }
975
975
 
976
976
  /**
@@ -8,7 +8,7 @@
8
8
  * @format
9
9
  */
10
10
 
11
- import type {HostComponent} from '../../Renderer/shims/ReactNativeTypes';
11
+ import type {HostInstance} from '../../Renderer/shims/ReactNativeTypes';
12
12
  import type {
13
13
  PressEvent,
14
14
  ScrollEvent,
@@ -22,7 +22,6 @@ import {
22
22
  type ViewStyleProp,
23
23
  } from '../../StyleSheet/StyleSheet';
24
24
  import * as React from 'react';
25
- type ComponentRef = React.ElementRef<HostComponent<mixed>>;
26
25
 
27
26
  type ReactRefSetter<T> = {current: null | T, ...} | ((ref: null | T) => mixed);
28
27
 
@@ -624,9 +623,7 @@ export type Props = $ReadOnly<{|
624
623
  */
625
624
  editable?: ?boolean,
626
625
 
627
- forwardedRef?: ?ReactRefSetter<
628
- React.ElementRef<HostComponent<mixed>> & ImperativeMethods,
629
- >,
626
+ forwardedRef?: ?ReactRefSetter<HostInstance & ImperativeMethods>,
630
627
 
631
628
  /**
632
629
  * `enterKeyHint` defines what action label (or icon) to present for the enter key on virtual keyboards.
@@ -972,7 +969,7 @@ export type Props = $ReadOnly<{|
972
969
  type ImperativeMethods = $ReadOnly<{|
973
970
  clear: () => void,
974
971
  isFocused: () => boolean,
975
- getNativeRef: () => ?React.ElementRef<HostComponent<mixed>>,
972
+ getNativeRef: () => ?HostInstance,
976
973
  setSelection: (start: number, end: number) => void,
977
974
  |}>;
978
975
 
@@ -1091,17 +1088,17 @@ type InternalTextInput = (props: Props) => React.Node;
1091
1088
 
1092
1089
  export type TextInputComponentStatics = $ReadOnly<{|
1093
1090
  State: $ReadOnly<{|
1094
- currentlyFocusedInput: () => ?ComponentRef,
1091
+ currentlyFocusedInput: () => ?HostInstance,
1095
1092
  currentlyFocusedField: () => ?number,
1096
- focusTextInput: (textField: ?ComponentRef) => void,
1097
- blurTextInput: (textField: ?ComponentRef) => void,
1093
+ focusTextInput: (textField: ?HostInstance) => void,
1094
+ blurTextInput: (textField: ?HostInstance) => void,
1098
1095
  |}>,
1099
1096
  |}>;
1100
1097
 
1101
1098
  export type TextInputType = React.AbstractComponent<
1102
1099
  React.ElementConfig<InternalTextInput>,
1103
1100
  $ReadOnly<{|
1104
- ...React.ElementRef<HostComponent<mixed>>,
1101
+ ...HostInstance,
1105
1102
  ...ImperativeMethods,
1106
1103
  |}>,
1107
1104
  > &
@@ -8,7 +8,7 @@
8
8
  * @format
9
9
  */
10
10
 
11
- import type {HostComponent} from '../../Renderer/shims/ReactNativeTypes';
11
+ import type {HostInstance} from '../../Renderer/shims/ReactNativeTypes';
12
12
  import type {____TextStyle_Internal as TextStyleInternal} from '../../StyleSheet/StyleSheetTypes';
13
13
  import type {
14
14
  PressEvent,
@@ -37,10 +37,10 @@ import * as React from 'react';
37
37
  import {useCallback, useLayoutEffect, useRef, useState} from 'react';
38
38
 
39
39
  type ReactRefSetter<T> = {current: null | T, ...} | ((ref: null | T) => mixed);
40
- type TextInputInstance = React.ElementRef<HostComponent<mixed>> & {
40
+ type TextInputInstance = HostInstance & {
41
41
  +clear: () => void,
42
42
  +isFocused: () => boolean,
43
- +getNativeRef: () => ?React.ElementRef<HostComponent<mixed>>,
43
+ +getNativeRef: () => ?HostInstance,
44
44
  +setSelection: (start: number, end: number) => void,
45
45
  };
46
46
 
@@ -1004,7 +1004,7 @@ function useTextInputStateSynchronization_STATE({
1004
1004
  props: Props,
1005
1005
  mostRecentEventCount: number,
1006
1006
  selection: ?Selection,
1007
- inputRef: React.RefObject<null | React.ElementRef<HostComponent<mixed>>>,
1007
+ inputRef: React.RefObject<null | HostInstance>,
1008
1008
  text: string,
1009
1009
  viewCommands: ViewCommands,
1010
1010
  }): {
@@ -1085,7 +1085,7 @@ function useTextInputStateSynchronization_REFS({
1085
1085
  props: Props,
1086
1086
  mostRecentEventCount: number,
1087
1087
  selection: ?Selection,
1088
- inputRef: React.RefObject<null | React.ElementRef<HostComponent<mixed>>>,
1088
+ inputRef: React.RefObject<null | HostInstance>,
1089
1089
  text: string,
1090
1090
  viewCommands: ViewCommands,
1091
1091
  }): {
@@ -1285,7 +1285,7 @@ function InternalTextInput(props: Props): React.Node {
1285
1285
  ...otherProps
1286
1286
  } = props;
1287
1287
 
1288
- const inputRef = useRef<null | React.ElementRef<HostComponent<mixed>>>(null);
1288
+ const inputRef = useRef<null | HostInstance>(null);
1289
1289
 
1290
1290
  const selection: ?Selection =
1291
1291
  propsSelection == null
@@ -1383,7 +1383,7 @@ function InternalTextInput(props: Props): React.Node {
1383
1383
  isFocused(): boolean {
1384
1384
  return TextInputState.currentlyFocusedInput() === inputRef.current;
1385
1385
  },
1386
- getNativeRef(): ?React.ElementRef<HostComponent<mixed>> {
1386
+ getNativeRef(): ?HostInstance {
1387
1387
  return inputRef.current;
1388
1388
  },
1389
1389
  setSelection(start: number, end: number): void {
@@ -8,7 +8,7 @@
8
8
  * @format
9
9
  */
10
10
 
11
- import type {HostComponent} from '../../Renderer/shims/ReactNativeTypes';
11
+ import type {HostInstance} from '../../Renderer/shims/ReactNativeTypes';
12
12
  import type {____TextStyle_Internal as TextStyleInternal} from '../../StyleSheet/StyleSheetTypes';
13
13
  import type {
14
14
  PressEvent,
@@ -37,10 +37,10 @@ import * as React from 'react';
37
37
  import {useCallback, useLayoutEffect, useRef, useState} from 'react';
38
38
 
39
39
  type ReactRefSetter<T> = {current: null | T, ...} | ((ref: null | T) => mixed);
40
- type TextInputInstance = React.ElementRef<HostComponent<mixed>> & {
40
+ type TextInputInstance = HostInstance & {
41
41
  +clear: () => void,
42
42
  +isFocused: () => boolean,
43
- +getNativeRef: () => ?React.ElementRef<HostComponent<mixed>>,
43
+ +getNativeRef: () => ?HostInstance,
44
44
  +setSelection: (start: number, end: number) => void,
45
45
  };
46
46
 
@@ -1047,7 +1047,7 @@ function useTextInputStateSynchronization_STATE({
1047
1047
  props: Props,
1048
1048
  mostRecentEventCount: number,
1049
1049
  selection: ?Selection,
1050
- inputRef: React.RefObject<null | React.ElementRef<HostComponent<mixed>>>,
1050
+ inputRef: React.RefObject<null | HostInstance>,
1051
1051
  text: string,
1052
1052
  viewCommands: ViewCommands,
1053
1053
  }): {
@@ -1128,7 +1128,7 @@ function useTextInputStateSynchronization_REFS({
1128
1128
  props: Props,
1129
1129
  mostRecentEventCount: number,
1130
1130
  selection: ?Selection,
1131
- inputRef: React.RefObject<null | React.ElementRef<HostComponent<mixed>>>,
1131
+ inputRef: React.RefObject<null | HostInstance>,
1132
1132
  text: string,
1133
1133
  viewCommands: ViewCommands,
1134
1134
  }): {
@@ -1330,7 +1330,7 @@ function InternalTextInput(props: Props): React.Node {
1330
1330
  ...otherProps
1331
1331
  } = props;
1332
1332
 
1333
- const inputRef = useRef<null | React.ElementRef<HostComponent<mixed>>>(null);
1333
+ const inputRef = useRef<null | HostInstance>(null);
1334
1334
 
1335
1335
  const selection: ?Selection =
1336
1336
  propsSelection == null
@@ -1433,7 +1433,7 @@ function InternalTextInput(props: Props): React.Node {
1433
1433
  currentlyFocusedInput === inputRef.current
1434
1434
  );
1435
1435
  },
1436
- getNativeRef(): ?React.ElementRef<HostComponent<mixed>> {
1436
+ getNativeRef(): ?HostInstance {
1437
1437
  return inputRef.current;
1438
1438
  },
1439
1439
  setSelection(start: number, end: number): void {
@@ -13,7 +13,7 @@
13
13
  // through here.
14
14
 
15
15
  import type {
16
- HostComponent,
16
+ HostInstance,
17
17
  MeasureInWindowOnSuccessCallback,
18
18
  MeasureLayoutOnSuccessCallback,
19
19
  MeasureOnSuccessCallback,
@@ -24,24 +24,22 @@ import {Commands as iOSTextInputCommands} from '../../Components/TextInput/RCTSi
24
24
 
25
25
  const {findNodeHandle} = require('../../ReactNative/RendererProxy');
26
26
  const Platform = require('../../Utilities/Platform');
27
- const React = require('react');
28
- type ComponentRef = React.ElementRef<HostComponent<mixed>>;
29
27
 
30
- let currentlyFocusedInputRef: ?ComponentRef = null;
28
+ let currentlyFocusedInputRef: ?HostInstance = null;
31
29
  const inputs = new Set<{
32
30
  blur(): void,
33
31
  focus(): void,
34
32
  measure(callback: MeasureOnSuccessCallback): void,
35
33
  measureInWindow(callback: MeasureInWindowOnSuccessCallback): void,
36
34
  measureLayout(
37
- relativeToNativeNode: number | React.ElementRef<HostComponent<mixed>>,
35
+ relativeToNativeNode: number | HostInstance,
38
36
  onSuccess: MeasureLayoutOnSuccessCallback,
39
37
  onFail?: () => void,
40
38
  ): void,
41
39
  setNativeProps(nativeProps: {...}): void,
42
40
  }>();
43
41
 
44
- function currentlyFocusedInput(): ?ComponentRef {
42
+ function currentlyFocusedInput(): ?HostInstance {
45
43
  return currentlyFocusedInputRef;
46
44
  }
47
45
 
@@ -59,13 +57,13 @@ function currentlyFocusedField(): ?number {
59
57
  return findNodeHandle(currentlyFocusedInputRef);
60
58
  }
61
59
 
62
- function focusInput(textField: ?ComponentRef): void {
60
+ function focusInput(textField: ?HostInstance): void {
63
61
  if (currentlyFocusedInputRef !== textField && textField != null) {
64
62
  currentlyFocusedInputRef = textField;
65
63
  }
66
64
  }
67
65
 
68
- function blurInput(textField: ?ComponentRef): void {
66
+ function blurInput(textField: ?HostInstance): void {
69
67
  if (currentlyFocusedInputRef === textField && textField != null) {
70
68
  currentlyFocusedInputRef = null;
71
69
  }
@@ -92,7 +90,7 @@ function blurField(textFieldID: ?number) {
92
90
  * Focuses the specified text field
93
91
  * noop if the text field was already focused or if the field is not editable
94
92
  */
95
- function focusTextInput(textField: ?ComponentRef) {
93
+ function focusTextInput(textField: ?HostInstance) {
96
94
  if (typeof textField === 'number') {
97
95
  if (__DEV__) {
98
96
  console.error(
@@ -131,7 +129,7 @@ function focusTextInput(textField: ?ComponentRef) {
131
129
  * Unfocuses the specified text field
132
130
  * noop if it wasn't focused
133
131
  */
134
- function blurTextInput(textField: ?ComponentRef) {
132
+ function blurTextInput(textField: ?HostInstance) {
135
133
  if (typeof textField === 'number') {
136
134
  if (__DEV__) {
137
135
  console.error(
@@ -157,7 +155,7 @@ function blurTextInput(textField: ?ComponentRef) {
157
155
  }
158
156
  }
159
157
 
160
- function registerInput(textField: ComponentRef) {
158
+ function registerInput(textField: HostInstance) {
161
159
  if (typeof textField === 'number') {
162
160
  if (__DEV__) {
163
161
  console.error(
@@ -171,7 +169,7 @@ function registerInput(textField: ComponentRef) {
171
169
  inputs.add(textField);
172
170
  }
173
171
 
174
- function unregisterInput(textField: ComponentRef) {
172
+ function unregisterInput(textField: HostInstance) {
175
173
  if (typeof textField === 'number') {
176
174
  if (__DEV__) {
177
175
  console.error(
@@ -184,7 +182,7 @@ function unregisterInput(textField: ComponentRef) {
184
182
  inputs.delete(textField);
185
183
  }
186
184
 
187
- function isTextInput(textField: ComponentRef): boolean {
185
+ function isTextInput(textField: HostInstance): boolean {
188
186
  if (typeof textField === 'number') {
189
187
  if (__DEV__) {
190
188
  console.error(
@@ -13,7 +13,7 @@
13
13
  // through here.
14
14
 
15
15
  import type {
16
- HostComponent,
16
+ HostInstance,
17
17
  MeasureInWindowOnSuccessCallback,
18
18
  MeasureLayoutOnSuccessCallback,
19
19
  MeasureOnSuccessCallback,
@@ -25,25 +25,22 @@ import {Commands as Win32TextInputCommands} from '../../Components/TextInput/Win
25
25
 
26
26
  const {findNodeHandle} = require('../../ReactNative/RendererProxy');
27
27
  const Platform = require('../../Utilities/Platform');
28
- const React = require('react');
29
28
 
30
- type ComponentRef = React.ElementRef<HostComponent<mixed>>;
31
-
32
- let currentlyFocusedInputRef: ?ComponentRef = null;
29
+ let currentlyFocusedInputRef: ?HostInstance = null;
33
30
  const inputs = new Set<{
34
31
  blur(): void,
35
32
  focus(): void,
36
33
  measure(callback: MeasureOnSuccessCallback): void,
37
34
  measureInWindow(callback: MeasureInWindowOnSuccessCallback): void,
38
35
  measureLayout(
39
- relativeToNativeNode: number | React.ElementRef<HostComponent<mixed>>,
36
+ relativeToNativeNode: number | HostInstance,
40
37
  onSuccess: MeasureLayoutOnSuccessCallback,
41
38
  onFail?: () => void,
42
39
  ): void,
43
40
  setNativeProps(nativeProps: {...}): void,
44
41
  }>();
45
42
 
46
- function currentlyFocusedInput(): ?ComponentRef {
43
+ function currentlyFocusedInput(): ?HostInstance {
47
44
  return currentlyFocusedInputRef;
48
45
  }
49
46
 
@@ -61,13 +58,13 @@ function currentlyFocusedField(): ?number {
61
58
  return findNodeHandle(currentlyFocusedInputRef);
62
59
  }
63
60
 
64
- function focusInput(textField: ?ComponentRef): void {
61
+ function focusInput(textField: ?HostInstance): void {
65
62
  if (currentlyFocusedInputRef !== textField && textField != null) {
66
63
  currentlyFocusedInputRef = textField;
67
64
  }
68
65
  }
69
66
 
70
- function blurInput(textField: ?ComponentRef): void {
67
+ function blurInput(textField: ?HostInstance): void {
71
68
  if (currentlyFocusedInputRef === textField && textField != null) {
72
69
  currentlyFocusedInputRef = null;
73
70
  }
@@ -94,7 +91,7 @@ function blurField(textFieldID: ?number) {
94
91
  * Focuses the specified text field
95
92
  * noop if the text field was already focused or if the field is not editable
96
93
  */
97
- function focusTextInput(textField: ?ComponentRef) {
94
+ function focusTextInput(textField: ?HostInstance) {
98
95
  if (typeof textField === 'number') {
99
96
  if (__DEV__) {
100
97
  console.error(
@@ -142,7 +139,7 @@ function focusTextInput(textField: ?ComponentRef) {
142
139
  * Unfocuses the specified text field
143
140
  * noop if it wasn't focused
144
141
  */
145
- function blurTextInput(textField: ?ComponentRef) {
142
+ function blurTextInput(textField: ?HostInstance) {
146
143
  if (typeof textField === 'number') {
147
144
  if (__DEV__) {
148
145
  console.error(
@@ -179,7 +176,7 @@ function blurTextInput(textField: ?ComponentRef) {
179
176
  * Should be called after the view has received focus and fired the onFocus event
180
177
  * noop if the focused text field is same
181
178
  */
182
- function setFocusedTextInput(textField: ComponentRef) {
179
+ function setFocusedTextInput(textField: HostInstance) {
183
180
  if (currentlyFocusedInputRef !== textField && textField !== null) {
184
181
  currentlyFocusedInputRef = textField;
185
182
  }
@@ -190,14 +187,14 @@ function setFocusedTextInput(textField: ComponentRef) {
190
187
  * Should be called after the view has cleared focus and fired the onFocus event
191
188
  * noop if the focused text field is not same
192
189
  */
193
- function clearFocusedTextInput(textField: ComponentRef) {
190
+ function clearFocusedTextInput(textField: HostInstance) {
194
191
  if (currentlyFocusedInputRef === textField && textField !== null) {
195
192
  currentlyFocusedInputRef = null;
196
193
  }
197
194
  }
198
195
  // Win32]
199
196
 
200
- function registerInput(textField: ComponentRef) {
197
+ function registerInput(textField: HostInstance) {
201
198
  if (typeof textField === 'number') {
202
199
  if (__DEV__) {
203
200
  console.error(
@@ -211,7 +208,7 @@ function registerInput(textField: ComponentRef) {
211
208
  inputs.add(textField);
212
209
  }
213
210
 
214
- function unregisterInput(textField: ComponentRef) {
211
+ function unregisterInput(textField: HostInstance) {
215
212
  if (typeof textField === 'number') {
216
213
  if (__DEV__) {
217
214
  console.error(
@@ -224,7 +221,7 @@ function unregisterInput(textField: ComponentRef) {
224
221
  inputs.delete(textField);
225
222
  }
226
223
 
227
- function isTextInput(textField: ComponentRef): boolean {
224
+ function isTextInput(textField: HostInstance): boolean {
228
225
  if (typeof textField === 'number') {
229
226
  if (__DEV__) {
230
227
  console.error(
@@ -36,6 +36,7 @@ const ReactNativeStyleAttributes: {[string]: AnyAttributeType, ...} = {
36
36
  borderRightWidth: true,
37
37
  borderStartWidth: true,
38
38
  borderTopWidth: true,
39
+ boxSizing: true,
39
40
  columnGap: true,
40
41
  borderWidth: true,
41
42
  bottom: true,
@@ -10,6 +10,7 @@
10
10
 
11
11
  import type {
12
12
  HostComponent,
13
+ HostInstance,
13
14
  PartialViewConfig,
14
15
  } from '../../Renderer/shims/ReactNativeTypes';
15
16
 
@@ -17,7 +18,6 @@ import * as NativeComponentRegistry from '../../NativeComponent/NativeComponentR
17
18
  import codegenNativeCommands from '../../Utilities/codegenNativeCommands';
18
19
  import Platform from '../../Utilities/Platform';
19
20
  import {type ViewProps as Props} from './ViewPropTypes';
20
- import * as React from 'react';
21
21
 
22
22
  export const __INTERNAL_VIEW_CONFIG: PartialViewConfig =
23
23
  Platform.OS === 'android'
@@ -108,15 +108,8 @@ const ViewNativeComponent: HostComponent<Props> =
108
108
  NativeComponentRegistry.get<Props>('RCTView', () => __INTERNAL_VIEW_CONFIG);
109
109
 
110
110
  interface NativeCommands {
111
- +hotspotUpdate: (
112
- viewRef: React.ElementRef<HostComponent<mixed>>,
113
- x: number,
114
- y: number,
115
- ) => void;
116
- +setPressed: (
117
- viewRef: React.ElementRef<HostComponent<mixed>>,
118
- pressed: boolean,
119
- ) => void;
111
+ +hotspotUpdate: (viewRef: HostInstance, x: number, y: number) => void;
112
+ +setPressed: (viewRef: HostInstance, pressed: boolean) => void;
120
113
  }
121
114
 
122
115
  export const Commands: NativeCommands = codegenNativeCommands<NativeCommands>({
@@ -17,7 +17,7 @@ const version: $ReadOnly<{
17
17
  major: 0,
18
18
  minor: 77,
19
19
  patch: 0,
20
- prerelease: 'nightly-20241001-223e98cc4',
20
+ prerelease: 'nightly-20241010-0d6908f4e',
21
21
  };
22
22
 
23
23
  module.exports = {version};
@@ -16,16 +16,7 @@ if (global.RN$Bridgeless === true && global.RN$registerCallableModule) {
16
16
  } else {
17
17
  const BatchedBridge = require('../BatchedBridge/BatchedBridge');
18
18
  registerModule = (
19
- moduleName:
20
- | $TEMPORARY$string<'GlobalPerformanceLogger'>
21
- | $TEMPORARY$string<'HMRClient'>
22
- | $TEMPORARY$string<'HeapCapture'>
23
- | $TEMPORARY$string<'JSTimers'>
24
- | $TEMPORARY$string<'RCTDeviceEventEmitter'>
25
- | $TEMPORARY$string<'RCTLog'>
26
- | $TEMPORARY$string<'RCTNativeAppEventEmitter'>
27
- | $TEMPORARY$string<'SamplingProfiler'>
28
- | $TEMPORARY$string<'Systrace'>,
19
+ moduleName: string,
29
20
  /* $FlowFixMe[missing-local-annot] The type annotation(s) required by
30
21
  * Flow's LTI update could not be added via codemod */
31
22
  factory,
@@ -10,18 +10,18 @@
10
10
 
11
11
  'use strict';
12
12
 
13
- import type {Domain} from '../../src/private/fusebox/setUpFuseboxReactDevToolsDispatcher';
13
+ import type {Domain} from '../../src/private/debugging/setUpFuseboxReactDevToolsDispatcher';
14
14
 
15
15
  if (__DEV__) {
16
16
  // Register dispatcher on global, which can be used later by Chrome DevTools frontend
17
- require('../../src/private/fusebox/setUpFuseboxReactDevToolsDispatcher');
17
+ require('../../src/private/debugging/setUpFuseboxReactDevToolsDispatcher');
18
18
  const {
19
19
  initialize,
20
20
  connectToDevTools,
21
21
  connectWithCustomMessagingProtocol,
22
22
  } = require('react-devtools-core');
23
23
 
24
- const reactDevToolsSettingsManager = require('../../src/private/reactdevtools/ReactDevToolsSettingsManager');
24
+ const reactDevToolsSettingsManager = require('../../src/private/debugging/ReactDevToolsSettingsManager');
25
25
  const serializedHookSettings =
26
26
  reactDevToolsSettingsManager.getGlobalHookSettings();
27
27
 
@@ -42,6 +42,7 @@ function __fetchSegment(
42
42
  const error = new Error(errorObject.message);
43
43
  (error: any).code = errorObject.code; // flowlint-line unclear-type: off
44
44
  callback(error);
45
+ return;
45
46
  }
46
47
 
47
48
  callback(null);
@@ -29,14 +29,14 @@ if (global.RN$Bridgeless !== true) {
29
29
  */
30
30
  const defineLazyTimer = (
31
31
  name:
32
- | $TEMPORARY$string<'cancelAnimationFrame'>
33
- | $TEMPORARY$string<'cancelIdleCallback'>
34
- | $TEMPORARY$string<'clearInterval'>
35
- | $TEMPORARY$string<'clearTimeout'>
36
- | $TEMPORARY$string<'requestAnimationFrame'>
37
- | $TEMPORARY$string<'requestIdleCallback'>
38
- | $TEMPORARY$string<'setInterval'>
39
- | $TEMPORARY$string<'setTimeout'>,
32
+ | 'cancelAnimationFrame'
33
+ | 'cancelIdleCallback'
34
+ | 'clearInterval'
35
+ | 'clearTimeout'
36
+ | 'requestAnimationFrame'
37
+ | 'requestIdleCallback'
38
+ | 'setInterval'
39
+ | 'setTimeout',
40
40
  ) => {
41
41
  polyfillGlobal(name, () => require('./Timers/JSTimers')[name]);
42
42
  };
@@ -8,10 +8,7 @@
8
8
  * @format
9
9
  */
10
10
 
11
- 'use strict';
12
-
13
- import type {ViewProps} from '../Components/View/ViewPropTypes';
14
- import type {HostComponent} from '../Renderer/shims/ReactNativeTypes';
11
+ import type {HostInstance} from '../Renderer/shims/ReactNativeTypes';
15
12
  import type {ImageBackgroundProps} from './ImageProps';
16
13
 
17
14
  import View from '../Components/View/View';
@@ -55,7 +52,7 @@ class ImageBackground extends React.Component<ImageBackgroundProps> {
55
52
 
56
53
  _viewRef: ?React.ElementRef<typeof View> = null;
57
54
 
58
- _captureRef = (ref: null | React.ElementRef<HostComponent<ViewProps>>) => {
55
+ _captureRef = (ref: null | HostInstance) => {
59
56
  this._viewRef = ref;
60
57
  };
61
58
 
@@ -65,7 +65,7 @@ type AndroidImageProps = $ReadOnly<{|
65
65
  * dimensions differ from the image view's dimensions. Defaults to `'auto'`.
66
66
  * See https://reactnative.dev/docs/image#resizemethod-android
67
67
  */
68
- resizeMethod?: ?('auto' | 'resize' | 'scale'),
68
+ resizeMethod?: ?('auto' | 'resize' | 'scale' | 'none'),
69
69
 
70
70
  /**
71
71
  * When the `resizeMethod` is set to `resize`, the destination dimensions are
@@ -11,6 +11,7 @@
11
11
  import type {ViewProps} from '../Components/View/ViewPropTypes';
12
12
  import type {
13
13
  HostComponent,
14
+ HostInstance,
14
15
  PartialViewConfig,
15
16
  } from '../Renderer/shims/ReactNativeTypes';
16
17
  import type {
@@ -20,7 +21,6 @@ import type {
20
21
  } from '../StyleSheet/StyleSheet';
21
22
  import type {ResolvedAssetSource} from './AssetSourceResolver';
22
23
  import type {ImageProps} from './ImageProps';
23
- import type {ElementRef} from 'react';
24
24
 
25
25
  import * as NativeComponentRegistry from '../NativeComponent/NativeComponentRegistry';
26
26
  import {ConditionallyIgnoredEventHandlers} from '../NativeComponent/ViewConfigIgnore';
@@ -48,7 +48,7 @@ type Props = $ReadOnly<{
48
48
 
49
49
  interface NativeCommands {
50
50
  +setIsVisible_EXPERIMENTAL: (
51
- viewRef: ElementRef<HostComponent<mixed>>,
51
+ viewRef: HostInstance,
52
52
  isVisible: boolean,
53
53
  time: number,
54
54
  ) => void;
@@ -20,7 +20,6 @@ import StyleSheet from '../StyleSheet/StyleSheet';
20
20
  import ElementBox from './ElementBox';
21
21
  import * as React from 'react';
22
22
 
23
- const {findNodeHandle} = require('../ReactNative/RendererProxy');
24
23
  const getInspectorDataForViewAtPoint = require('./getInspectorDataForViewAtPoint');
25
24
 
26
25
  const {useEffect, useState, useCallback} = React;
@@ -9,18 +9,16 @@
9
9
  */
10
10
 
11
11
  import type {
12
- HostComponent,
12
+ HostInstance,
13
13
  TouchedViewDataAtPoint,
14
14
  } from '../Renderer/shims/ReactNativeTypes';
15
15
 
16
16
  const invariant = require('invariant');
17
- const React = require('react');
18
17
 
19
- export type HostRef = React.ElementRef<HostComponent<mixed>>;
20
18
  export type ReactRenderer = {
21
19
  rendererConfig: {
22
20
  getInspectorDataForViewAtPoint: (
23
- inspectedView: ?HostRef,
21
+ inspectedView: ?HostInstance,
24
22
  locationX: number,
25
23
  locationY: number,
26
24
  callback: Function,
@@ -52,7 +50,7 @@ function validateRenderers(): void {
52
50
  }
53
51
 
54
52
  module.exports = function getInspectorDataForViewAtPoint(
55
- inspectedView: ?HostRef,
53
+ inspectedView: ?HostInstance,
56
54
  locationX: number,
57
55
  locationY: number,
58
56
  callback: (viewData: TouchedViewDataAtPoint) => boolean,