react-native-windows 0.0.0-canary.992 → 0.0.0-canary.993

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 (195) hide show
  1. package/.flowconfig +3 -1
  2. package/Libraries/Animated/Animated.js +0 -1
  3. package/Libraries/Animated/Animated.js.flow +0 -1
  4. package/Libraries/Animated/AnimatedExports.js +0 -1
  5. package/Libraries/Animated/AnimatedExports.js.flow +1 -2
  6. package/Libraries/Animated/animations/Animation.js +5 -2
  7. package/Libraries/Animated/components/AnimatedScrollView.js +53 -52
  8. package/Libraries/Animated/createAnimatedComponent.js +37 -33
  9. package/Libraries/Animated/nodes/AnimatedObject.js +2 -3
  10. package/Libraries/Animated/nodes/AnimatedProps.js +1 -1
  11. package/Libraries/Animated/shouldUseTurboAnimatedModule.js +6 -1
  12. package/Libraries/AppState/AppState.js +6 -1
  13. package/Libraries/Components/ActivityIndicator/ActivityIndicator.js +19 -18
  14. package/Libraries/Components/Button.js +2 -2
  15. package/Libraries/Components/Button.windows.js +2 -3
  16. package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.android.js +2 -3
  17. package/Libraries/Components/Keyboard/KeyboardAvoidingView.js +2 -1
  18. package/Libraries/Components/LayoutConformance/LayoutConformance.js +0 -1
  19. package/Libraries/Components/Pressable/Pressable.js +9 -6
  20. package/Libraries/Components/Pressable/Pressable.windows.js +9 -6
  21. package/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.android.js +14 -13
  22. package/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.js +13 -1
  23. package/Libraries/Components/ProgressBarAndroid/ProgressBarAndroidTypes.js +29 -20
  24. package/Libraries/Components/ScrollView/ScrollView.d.ts +9 -5
  25. package/Libraries/Components/ScrollView/ScrollView.js +18 -12
  26. package/Libraries/Components/ScrollView/ScrollView.windows.js +19 -12
  27. package/Libraries/Components/ScrollView/ScrollViewContext.js +2 -1
  28. package/Libraries/Components/ScrollView/ScrollViewNativeComponentType.js +1 -1
  29. package/Libraries/Components/ScrollView/ScrollViewStickyHeader.js +19 -6
  30. package/Libraries/Components/Switch/Switch.js +8 -2
  31. package/Libraries/Components/Switch/Switch.windows.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.windows.js +1 -6
  35. package/Libraries/Components/TextInput/TextInput.js +26 -25
  36. package/Libraries/Components/TextInput/TextInput.windows.js +27 -25
  37. package/Libraries/Components/TextInput/WindowsTextInputNativeComponent.js +1 -5
  38. package/Libraries/Components/Touchable/TouchableBounce.js +9 -3
  39. package/Libraries/Components/Touchable/TouchableBounce.windows.js +9 -3
  40. package/Libraries/Components/Touchable/TouchableHighlight.js +9 -4
  41. package/Libraries/Components/Touchable/TouchableHighlight.windows.js +9 -4
  42. package/Libraries/Components/Touchable/TouchableNativeFeedback.js +2 -1
  43. package/Libraries/Components/Touchable/TouchableNativeFeedback.windows.js +2 -1
  44. package/Libraries/Components/Touchable/TouchableOpacity.js +7 -3
  45. package/Libraries/Components/Touchable/TouchableOpacity.windows.js +7 -3
  46. package/Libraries/Components/Touchable/TouchableWithoutFeedback.js +2 -2
  47. package/Libraries/Components/Touchable/TouchableWithoutFeedback.windows.js +2 -2
  48. package/Libraries/Components/View/View.js +111 -25
  49. package/Libraries/Components/View/View.windows.js +427 -227
  50. package/Libraries/Core/Devtools/loadBundleFromServer.js +49 -7
  51. package/Libraries/Core/Devtools/loadBundleFromServer.windows.js +49 -7
  52. package/Libraries/Core/InitializeCore.js +1 -22
  53. package/Libraries/Core/ReactNativeVersion.js +3 -2
  54. package/Libraries/Debugging/DebuggingOverlay.js +6 -8
  55. package/Libraries/Debugging/DebuggingOverlayRegistry.js +0 -1
  56. package/Libraries/Debugging/useSubscribeToDebuggingOverlayRegistry.js +0 -1
  57. package/Libraries/EventEmitter/NativeEventEmitter.js +1 -1
  58. package/Libraries/Image/AssetRegistry.js +4 -10
  59. package/Libraries/Image/AssetSourceResolver.js +17 -4
  60. package/Libraries/Image/AssetSourceResolver.windows.js +17 -4
  61. package/Libraries/Image/Image.android.js +112 -106
  62. package/Libraries/Image/Image.ios.js +10 -2
  63. package/Libraries/Image/Image.windows.js +30 -20
  64. package/Libraries/Image/ImageAnalyticsTagContext.js +2 -2
  65. package/Libraries/Image/RelativeImageStub.js +1 -0
  66. package/Libraries/Lists/FlatList.d.ts +9 -5
  67. package/Libraries/Lists/FlatList.js +1 -1
  68. package/Libraries/Lists/SectionListModern.js +9 -3
  69. package/Libraries/LogBox/UI/LogBoxButton.js +2 -1
  70. package/Libraries/LogBox/UI/LogBoxInspectorReactFrames.js +2 -1
  71. package/Libraries/LogBox/UI/LogBoxInspectorReactFrames.windows.js +2 -1
  72. package/Libraries/LogBox/UI/LogBoxInspectorSourceMapStatus.js +3 -2
  73. package/Libraries/LogBox/UI/LogBoxInspectorStackFrames.js +2 -1
  74. package/Libraries/ReactNative/AppContainer-dev.js +4 -4
  75. package/Libraries/ReactNative/AppContainer-prod.js +0 -1
  76. package/Libraries/ReactNative/RootTag.js +2 -2
  77. package/Libraries/ReactPrivate/ReactNativePrivateInterface.js +1 -0
  78. package/Libraries/Renderer/shims/ReactNativeTypes.js +21 -25
  79. package/Libraries/Renderer/shims/ReactNativeTypes.windows.js +270 -0
  80. package/Libraries/StyleSheet/StyleSheetExports.js.flow +3 -1
  81. package/Libraries/StyleSheet/StyleSheetTypes.js +4 -3
  82. package/Libraries/StyleSheet/private/_TransformStyle.js +49 -21
  83. package/Libraries/StyleSheet/processBoxShadow.js +0 -1
  84. package/Libraries/StyleSheet/processFilter.js +0 -1
  85. package/Libraries/Text/Text.d.ts +1 -2
  86. package/Libraries/Text/Text.js +255 -244
  87. package/Libraries/Text/Text.windows.js +281 -300
  88. package/Libraries/Text/TextAncestor.js +3 -2
  89. package/Libraries/Text/TextProps.js +2 -34
  90. package/Libraries/Text/TextProps.windows.js +2 -34
  91. package/Libraries/Types/ReactDevToolsTypes.js +0 -1
  92. package/Libraries/Utilities/PerformanceLoggerContext.js +2 -2
  93. package/Libraries/Utilities/PlatformTypes.js +1 -1
  94. package/Libraries/vendor/core/ErrorUtils.js +28 -4
  95. package/Microsoft.ReactNative/Fabric/AbiComponentDescriptor.cpp +1 -1
  96. package/Microsoft.ReactNative/Fabric/AbiComponentDescriptor.h +1 -1
  97. package/Microsoft.ReactNative/Fabric/AbiShadowNode.h +1 -1
  98. package/Microsoft.ReactNative/Fabric/AbiViewComponentDescriptor.h +1 -1
  99. package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentDescriptor.h +2 -2
  100. package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentView.cpp +10 -9
  101. package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputShadowNode.cpp +21 -17
  102. package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputShadowNode.h +4 -4
  103. package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputState.cpp +19 -0
  104. package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputState.h +76 -0
  105. package/Microsoft.ReactNative/Fabric/platform/react/renderer/textlayoutmanager/WindowsTextLayoutManager.cpp +6 -0
  106. package/Microsoft.ReactNative/Modules/PaperUIManagerModule.cpp +19 -2
  107. package/Microsoft.ReactNative/Utils/ThemeUtils.cpp +49 -0
  108. package/Microsoft.ReactNative/Utils/ThemeUtils.h +31 -0
  109. package/Microsoft.ReactNative/Views/ShadowNodeBase.cpp +36 -8
  110. package/Microsoft.ReactNative/Views/ShadowNodeRegistry.cpp +6 -2
  111. package/Microsoft.ReactNative/Views/ViewManagerBase.cpp +9 -1
  112. package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/Base.h +45 -34
  113. package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/Bool.h +1 -1
  114. package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/Bridging.h +1 -0
  115. package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/Class.h +36 -33
  116. package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/Number.h +10 -10
  117. package/PropertySheets/External/Microsoft.ReactNative.Cpp.Dependencies.props +10 -0
  118. package/PropertySheets/Generated/PackageVersion.g.props +2 -2
  119. package/PropertySheets/React.Cpp.props +1 -1
  120. package/ReactCommon/ReactCommon.vcxproj +10 -19
  121. package/ReactCommon/ReactCommon.vcxproj.filters +36 -13
  122. package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/NativeToJsBridge.cpp +1 -1
  123. package/ReactCommon/TEMP_UntilReactCommonUpdate/jsi/jsi/test/testlib.cpp +110 -0
  124. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/bridging/Bridging.h +1 -0
  125. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/nativemodule/dom/NativeDOM.cpp +19 -3
  126. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/nativemodule/dom/NativeDOM.h +9 -0
  127. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/text/ParagraphShadowNode.cpp +459 -0
  128. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/text/platform/android/react/renderer/components/text/ParagraphState.h +92 -0
  129. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/view/AccessibilityPrimitives.h +35 -0
  130. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/view/AccessibilityProps.cpp +28 -1
  131. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/css/CSSTokenizer.h +1 -2
  132. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/runtime/ReactInstance.cpp +2 -1
  133. package/Scripts/creaternwapp.cmd +11 -8
  134. package/Shared/HermesRuntimeHolder.cpp +3 -1
  135. package/Shared/Shared.vcxitems +5 -1
  136. package/Shared/Shared.vcxitems.filters +4 -0
  137. package/codegen/NativeDOMSpec.g.h +6 -0
  138. package/codegen/NativeIntersectionObserverSpec.g.h +19 -5
  139. package/codegen/NativeMutationObserverSpec.g.h +11 -5
  140. package/codegen/NativeReactNativeFeatureFlagsSpec.g.h +104 -92
  141. package/codegen/react/components/rnwcore/States.h +8 -8
  142. package/codegen/rnwcoreJSI-generated.cpp +48 -3
  143. package/codegen/rnwcoreJSI.h +73 -10
  144. package/index.js +0 -1
  145. package/jest/mockNativeComponent.js +2 -1
  146. package/jest/renderer.js +0 -1
  147. package/jest/resolver.js +31 -0
  148. package/package.json +13 -13
  149. package/src/private/animated/NativeAnimatedHelper.js +6 -1
  150. package/src/private/animated/createAnimatedPropsHook.js +11 -4
  151. package/src/private/animated/createAnimatedPropsMemoHook.js +0 -1
  152. package/src/private/components/safeareaview/SafeAreaView_INTERNAL_DO_NOT_USE.js +0 -1
  153. package/src/private/components/scrollview/HScrollViewNativeComponents.js +0 -1
  154. package/src/private/components/scrollview/VScrollViewNativeComponents.js +0 -1
  155. package/src/private/devsupport/rndevtools/FuseboxSessionObserver.js +0 -1
  156. package/src/private/devsupport/rndevtools/ReactDevToolsSettingsManager.android.js +8 -9
  157. package/src/private/devsupport/rndevtools/ReactDevToolsSettingsManager.ios.js +12 -15
  158. package/src/private/devsupport/rndevtools/ReactDevToolsSettingsManager.windows.js +8 -9
  159. package/src/private/devsupport/rndevtools/setUpFuseboxReactDevToolsDispatcher.js +0 -1
  160. package/src/private/devsupport/rndevtools/specs/NativeReactDevToolsRuntimeSettingsModule.js +0 -1
  161. package/src/private/featureflags/ReactNativeFeatureFlags.js +39 -4
  162. package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +5 -2
  163. package/src/private/setup/setUpDefaultReactNativeEnvironment.js +44 -0
  164. package/src/private/styles/composeStyles.js +12 -5
  165. package/src/private/webapis/dom/events/Event.js +3 -0
  166. package/src/private/webapis/dom/events/EventTarget.js +3 -0
  167. package/src/private/webapis/dom/nodes/ReactNativeElement.js +6 -23
  168. package/src/private/webapis/dom/nodes/ReadOnlyNode.js +3 -1
  169. package/src/private/webapis/dom/nodes/specs/NativeDOM.js +38 -0
  170. package/src/private/webapis/dom/oldstylecollections/HTMLCollection.js +3 -0
  171. package/src/private/webapis/dom/oldstylecollections/NodeList.js +3 -0
  172. package/src/private/webapis/errors/DOMException.js +166 -0
  173. package/src/private/webapis/geometry/DOMRect.js +5 -0
  174. package/src/private/webapis/geometry/DOMRectList.js +3 -0
  175. package/src/private/webapis/geometry/DOMRectReadOnly.js +6 -0
  176. package/src/private/webapis/intersectionobserver/IntersectionObserver.js +15 -7
  177. package/src/private/webapis/intersectionobserver/IntersectionObserverEntry.js +3 -0
  178. package/src/private/webapis/intersectionobserver/internals/IntersectionObserverManager.js +80 -18
  179. package/src/private/webapis/intersectionobserver/specs/NativeIntersectionObserver.js +12 -0
  180. package/src/private/webapis/mutationobserver/MutationObserver.js +23 -33
  181. package/src/private/webapis/mutationobserver/MutationRecord.js +3 -0
  182. package/src/private/webapis/mutationobserver/internals/MutationObserverManager.js +56 -24
  183. package/src/private/webapis/mutationobserver/specs/NativeMutationObserver.js +4 -1
  184. package/src/private/webapis/performance/MemoryInfo.js +4 -1
  185. package/src/private/webapis/performance/Performance.js +19 -8
  186. package/src/private/webapis/performance/PerformanceEntry.js +4 -0
  187. package/src/private/webapis/performance/ReactNativeStartupTiming.js +4 -1
  188. package/src/private/webapis/performance/internals/RawPerformanceEntry.js +2 -0
  189. package/src/private/webapis/structuredClone/structuredClone.js +233 -0
  190. package/src/private/webapis/webidl/PlatformObjects.js +59 -0
  191. package/src/types/globals.d.ts +42 -0
  192. package/templates/cpp-lib/windows/MyLib/MyLib.vcxproj +0 -1
  193. package/types/index.d.ts +1 -1
  194. package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/JSExecutor.cpp +0 -78
  195. package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/JSExecutor.h +0 -196
@@ -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
 
@@ -107,7 +109,13 @@ async function queryCache(
107
109
  *
108
110
  * See https://reactnative.dev/docs/image
109
111
  */
110
- let BaseImage: AbstractImageIOS = React.forwardRef((props, forwardedRef) => {
112
+ let BaseImage: AbstractImageIOS = ({
113
+ ref: forwardedRef,
114
+ ...props
115
+ }: {
116
+ ref?: React.RefSetter<HostInstance>,
117
+ ...ImageProps,
118
+ }) => {
111
119
  const source = getImageSourcesFromImageProps(props) || {
112
120
  uri: undefined,
113
121
  width: undefined,
@@ -214,28 +222,30 @@ let BaseImage: AbstractImageIOS = React.forwardRef((props, forwardedRef) => {
214
222
  } else {
215
223
  return (
216
224
  <ImageAnalyticsTagContext.Consumer>
217
- {analyticTag => (
218
- <ImageViewNativeComponent
219
- accessibilityState={_accessibilityState}
220
- {...restProps}
221
- accessible={props.alt !== undefined ? true : props.accessible}
222
- accessibilityLabel={accessibilityLabel ?? props.alt}
223
- accessibilityLevel={accessibilityLevel} // Windows
224
- accessibilityPosInSet={accessibilityPosInSet} // Windows
225
- accessibilitySetSize={accessibilitySetSize} // Windows
226
- ref={actualRef}
227
- style={style}
228
- resizeMode={resizeMode}
229
- tintColor={tintColor}
230
- source={sources}
231
- internal_analyticTag={analyticTag}
232
- />
233
- )}
225
+ {analyticTag => {
226
+ return (
227
+ <ImageViewNativeComponent
228
+ accessibilityState={_accessibilityState}
229
+ {...restProps}
230
+ accessible={props.alt !== undefined ? true : props.accessible}
231
+ accessibilityLabel={accessibilityLabel ?? props.alt}
232
+ accessibilityLevel={accessibilityLevel} // Windows
233
+ accessibilityPosInSet={accessibilityPosInSet} // Windows
234
+ accessibilitySetSize={accessibilitySetSize} // Windows
235
+ ref={actualRef}
236
+ style={style}
237
+ resizeMode={resizeMode}
238
+ tintColor={tintColor}
239
+ source={sources}
240
+ internal_analyticTag={analyticTag}
241
+ />
242
+ );
243
+ }}
234
244
  </ImageAnalyticsTagContext.Consumer>
235
245
  );
246
+ // Windows]
236
247
  }
237
- // Windows]
238
- });
248
+ };
239
249
 
240
250
  const imageComponentDecorator = unstable_getImageComponentDecorator();
241
251
  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);
@@ -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;
@@ -7,25 +7,21 @@
7
7
  * @noformat
8
8
  * @nolint
9
9
  * @flow strict
10
- * @generated SignedSource<<2264e9839602043a41f1e13913b43b0f>>
10
+ * @generated SignedSource<<4216c04f5a8c40a833b0146588fab5fa>>
11
11
  */
12
12
 
13
- import type {
14
- Component as ReactComponent,
15
- ElementRef,
16
- ElementType,
17
- MixedElement,
18
- } from 'react';
19
13
  import type {
20
14
  // $FlowFixMe[nonstrict-import] TODO(@rubennorte)
21
- MeasureOnSuccessCallback,
15
+ HostInstance as PublicInstance,
22
16
  // $FlowFixMe[nonstrict-import] TODO(@rubennorte)
23
- PublicInstance,
17
+ MeasureOnSuccessCallback,
24
18
  // $FlowFixMe[nonstrict-import] TODO(@rubennorte)
25
19
  PublicRootInstance,
26
20
  // $FlowFixMe[nonstrict-import] TODO(@rubennorte)
27
21
  PublicTextInstance,
28
- } from 'react-native/Libraries/ReactPrivate/ReactNativePrivateInterface';
22
+ } from 'react-native';
23
+
24
+ import * as React from 'react';
29
25
 
30
26
  export type AttributeType<T, V> =
31
27
  | true
@@ -97,8 +93,8 @@ type InspectorDataProps = $ReadOnly<{
97
93
  }>;
98
94
 
99
95
  type InspectorDataGetter = (
100
- <TElementType: ElementType>(
101
- componentOrHandle: ElementRef<TElementType> | number,
96
+ <TElementType: React.ElementType>(
97
+ componentOrHandle: React.ElementRef<TElementType> | number,
102
98
  ) => ?number,
103
99
  ) => $ReadOnly<{
104
100
  measure: (callback: MeasureOnSuccessCallback) => void,
@@ -141,7 +137,7 @@ export type RenderRootOptions = {
141
137
  +componentStack?: ?string,
142
138
  // $FlowFixMe[unclear-type] unknown props and state.
143
139
  // $FlowFixMe[value-as-type] Component in react repo is any-typed, but it will be well typed externally.
144
- +errorBoundary?: ?ReactComponent<any, any>,
140
+ +errorBoundary?: ?React.Component<any, any>,
145
141
  },
146
142
  ) => void,
147
143
  onRecoverableError?: (
@@ -155,11 +151,11 @@ export type RenderRootOptions = {
155
151
  * Provide minimal Flow typing for the high-level RN API and call it a day.
156
152
  */
157
153
  export type ReactNativeType = {
158
- findHostInstance_DEPRECATED<TElementType: ElementType>(
159
- componentOrHandle: ?(ElementRef<TElementType> | number),
154
+ findHostInstance_DEPRECATED<TElementType: React.ElementType>(
155
+ componentOrHandle: ?(React.ElementRef<TElementType> | number),
160
156
  ): ?PublicInstance,
161
- findNodeHandle<TElementType: ElementType>(
162
- componentOrHandle: ?(ElementRef<TElementType> | number),
157
+ findNodeHandle<TElementType: React.ElementType>(
158
+ componentOrHandle: ?(React.ElementRef<TElementType> | number),
163
159
  ): ?number,
164
160
  isChildPublicInstance(parent: PublicInstance, child: PublicInstance): boolean,
165
161
  dispatchCommand(
@@ -169,11 +165,11 @@ export type ReactNativeType = {
169
165
  ): void,
170
166
  sendAccessibilityEvent(handle: PublicInstance, eventType: string): void,
171
167
  render(
172
- element: MixedElement,
168
+ element: React.MixedElement,
173
169
  containerTag: number,
174
170
  callback: ?() => void,
175
171
  options: ?RenderRootOptions,
176
- ): ?ElementRef<ElementType>,
172
+ ): ?React.ElementRef<React.ElementType>,
177
173
  unmountComponentAtNode(containerTag: number): void,
178
174
  unmountComponentAtNodeAndRemoveContainer(containerTag: number): void,
179
175
  +unstable_batchedUpdates: <T>(fn: (T) => void, bookkeeping: T) => void,
@@ -184,11 +180,11 @@ export opaque type Node = mixed;
184
180
  export opaque type InternalInstanceHandle = mixed;
185
181
 
186
182
  export type ReactFabricType = {
187
- findHostInstance_DEPRECATED<TElementType: ElementType>(
188
- componentOrHandle: ?(ElementRef<TElementType> | number),
183
+ findHostInstance_DEPRECATED<TElementType: React.ElementType>(
184
+ componentOrHandle: ?(React.ElementRef<TElementType> | number),
189
185
  ): ?PublicInstance,
190
- findNodeHandle<TElementType: ElementType>(
191
- componentOrHandle: ?(ElementRef<TElementType> | number),
186
+ findNodeHandle<TElementType: React.ElementType>(
187
+ componentOrHandle: ?(React.ElementRef<TElementType> | number),
192
188
  ): ?number,
193
189
  dispatchCommand(
194
190
  handle: PublicInstance,
@@ -198,12 +194,12 @@ export type ReactFabricType = {
198
194
  isChildPublicInstance(parent: PublicInstance, child: PublicInstance): boolean,
199
195
  sendAccessibilityEvent(handle: PublicInstance, eventType: string): void,
200
196
  render(
201
- element: MixedElement,
197
+ element: React.MixedElement,
202
198
  containerTag: number,
203
199
  callback: ?() => void,
204
200
  concurrentRoot: ?boolean,
205
201
  options: ?RenderRootOptions,
206
- ): ?ElementRef<ElementType>,
202
+ ): ?React.ElementRef<React.ElementType>,
207
203
  unmountComponentAtNode(containerTag: number): void,
208
204
  getNodeFromInternalInstanceHandle(
209
205
  internalInstanceHandle: InternalInstanceHandle,