@office-iss/react-native-win32 0.72.7 → 0.73.0-preview.1

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 (272) hide show
  1. package/.flowconfig +15 -4
  2. package/CHANGELOG.json +523 -94
  3. package/CHANGELOG.md +209 -52
  4. package/IntegrationTests/PromiseTest.js +1 -0
  5. package/IntegrationTests/websocket_integration_test_server.js +1 -1
  6. package/Libraries/Animated/Animated.js +1 -1
  7. package/Libraries/Animated/AnimatedImplementation.js +1 -1
  8. package/Libraries/Animated/NativeAnimatedHelper.js +14 -10
  9. package/Libraries/Animated/NativeAnimatedHelper.win32.js +16 -12
  10. package/Libraries/Animated/NativeAnimatedModule.js +6 -2
  11. package/Libraries/Animated/NativeAnimatedTurboModule.js +7 -4
  12. package/Libraries/Animated/animations/Animation.js +57 -3
  13. package/Libraries/Animated/animations/DecayAnimation.js +9 -0
  14. package/Libraries/Animated/animations/SpringAnimation.js +8 -0
  15. package/Libraries/Animated/animations/TimingAnimation.js +8 -0
  16. package/Libraries/Animated/components/AnimatedFlatList.js +2 -1
  17. package/Libraries/Animated/components/AnimatedScrollView.js +2 -0
  18. package/Libraries/Animated/components/AnimatedSectionList.js +2 -1
  19. package/Libraries/Animated/createAnimatedComponent.js +1 -0
  20. package/Libraries/Animated/nodes/AnimatedColor.js +1 -1
  21. package/Libraries/Animated/nodes/AnimatedObject.js +146 -0
  22. package/Libraries/Animated/nodes/AnimatedProps.js +19 -7
  23. package/Libraries/Animated/nodes/AnimatedStyle.js +29 -55
  24. package/Libraries/Animated/nodes/AnimatedValueXY.js +3 -17
  25. package/Libraries/Animated/shouldUseTurboAnimatedModule.js +17 -0
  26. package/Libraries/Animated/useAnimatedProps.js +9 -10
  27. package/Libraries/AppState/AppState.d.ts +1 -1
  28. package/Libraries/AppState/NativeAppState.js +8 -4
  29. package/Libraries/BatchedBridge/MessageQueue.js +45 -36
  30. package/Libraries/Blob/Blob.js +6 -2
  31. package/Libraries/Blob/BlobManager.js +9 -10
  32. package/Libraries/Blob/BlobRegistry.js +14 -9
  33. package/Libraries/Blob/File.js +1 -1
  34. package/Libraries/Blob/FileReader.js +1 -2
  35. package/Libraries/Components/Button/ButtonWin32.Props.d.ts +1 -1
  36. package/Libraries/Components/Button/ButtonWin32.Props.js.map +1 -1
  37. package/Libraries/Components/Button/ButtonWin32.d.ts +1 -1
  38. package/Libraries/Components/Button/ButtonWin32.js +1 -4
  39. package/Libraries/Components/Button/ButtonWin32.js.map +1 -1
  40. package/Libraries/Components/Clipboard/Clipboard.d.ts +4 -4
  41. package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.android.js +3 -1
  42. package/Libraries/Components/EnterString.win32.d.ts +1 -1
  43. package/Libraries/Components/Keyboard/KeyboardAvoidingView.js +26 -6
  44. package/Libraries/Components/Pressable/Pressable.js +3 -2
  45. package/Libraries/Components/Pressable/Pressable.win32.js +4 -3
  46. package/Libraries/Components/Pressable/useAndroidRippleForView.js +1 -1
  47. package/Libraries/Components/SafeAreaView/SafeAreaView.js +7 -7
  48. package/Libraries/Components/SafeAreaView/SafeAreaView.win32.js +7 -8
  49. package/Libraries/Components/ScrollView/ScrollView.js +3 -1
  50. package/Libraries/Components/ScrollView/ScrollView.win32.js +3 -1
  51. package/Libraries/Components/ScrollView/ScrollViewStickyHeader.js +39 -46
  52. package/Libraries/Components/Switch/Switch.js +1 -0
  53. package/Libraries/Components/Text/TextWin32.d.ts +1 -1
  54. package/Libraries/Components/TextInput/RCTTextInputViewConfig.js +1 -0
  55. package/Libraries/Components/TextInput/TextInput.d.ts +49 -7
  56. package/Libraries/Components/TextInput/TextInput.flow.js +43 -10
  57. package/Libraries/Components/TextInput/TextInput.js +62 -10
  58. package/Libraries/Components/TextInput/TextInput.win32.js +953 -206
  59. package/Libraries/Components/TextInput/Win32TextInputNativeComponent.js +23 -0
  60. package/Libraries/Components/ToastAndroid/{ToastAndroid.ios.js → ToastAndroid.js} +9 -1
  61. package/Libraries/Components/ToastAndroid/ToastAndroid.win32.js +9 -1
  62. package/Libraries/Components/Touchable/Tests/TouchableWin32Test.js +2 -2
  63. package/Libraries/Components/Touchable/Tests/TouchableWin32Test.js.map +1 -1
  64. package/Libraries/Components/Touchable/TouchableBounce.js +1 -1
  65. package/Libraries/Components/Touchable/TouchableHighlight.js +1 -1
  66. package/Libraries/Components/Touchable/TouchableNativeFeedback.js +1 -1
  67. package/Libraries/Components/Touchable/TouchableOpacity.js +4 -1
  68. package/Libraries/Components/Touchable/TouchableWin32.d.ts +1 -1
  69. package/Libraries/Components/Touchable/TouchableWin32.js.map +1 -1
  70. package/Libraries/Components/Touchable/TouchableWithoutFeedback.js +1 -0
  71. package/Libraries/Components/TraceUpdateOverlay/TraceUpdateOverlay.js +16 -6
  72. package/Libraries/Components/View/ReactNativeStyleAttributes.js +9 -0
  73. package/Libraries/Components/View/ReactNativeViewAttributes.js +1 -0
  74. package/Libraries/Components/View/ReactNativeViewAttributes.win32.js +1 -0
  75. package/Libraries/Components/View/View.js +46 -32
  76. package/Libraries/Components/View/View.win32.js +37 -6
  77. package/Libraries/Components/View/ViewAccessibility.d.ts +8 -2
  78. package/Libraries/Components/View/ViewNativeComponent.js +1 -0
  79. package/Libraries/Components/View/ViewPropTypes.js +18 -3
  80. package/Libraries/Components/View/ViewPropTypes.win32.js +30 -4
  81. package/Libraries/Components/View/ViewWin32.js +3 -2
  82. package/Libraries/Core/Devtools/loadBundleFromServer.js +152 -0
  83. package/Libraries/Core/Devtools/symbolicateStackTrace.js +2 -1
  84. package/Libraries/Core/ExceptionsManager.js +16 -7
  85. package/Libraries/Core/ExtendedError.js +12 -0
  86. package/Libraries/Core/ReactNativeVersion.js +3 -3
  87. package/Libraries/Core/ReactNativeVersionCheck.js +0 -2
  88. package/Libraries/Core/ReactNativeVersionCheck.win32.js +0 -2
  89. package/Libraries/Core/__mocks__/NativeExceptionsManager.js +20 -0
  90. package/Libraries/Core/setUpDeveloperTools.js +5 -1
  91. package/Libraries/Core/setUpIntersectionObserver.js +16 -0
  92. package/Libraries/{Components/ProgressBarAndroid/ProgressBarAndroid.ios.js → Core/setUpMutationObserver.js} +6 -2
  93. package/Libraries/Core/setUpPerformance.js +6 -13
  94. package/Libraries/Core/setUpPerformanceObserver.js +16 -0
  95. package/Libraries/Core/setUpRegeneratorRuntime.js +4 -2
  96. package/Libraries/DOM/Nodes/ReactNativeElement.js +135 -18
  97. package/Libraries/DOM/Nodes/ReadOnlyCharacterData.js +72 -0
  98. package/Libraries/DOM/Nodes/ReadOnlyElement.js +209 -21
  99. package/Libraries/DOM/Nodes/ReadOnlyNode.js +206 -17
  100. package/Libraries/DOM/Nodes/ReadOnlyText.js +30 -0
  101. package/Libraries/DOM/Nodes/Utilities/Traversal.js +54 -0
  102. package/Libraries/EventEmitter/NativeEventEmitter.d.ts +0 -6
  103. package/Libraries/EventEmitter/RCTDeviceEventEmitter.js +15 -4
  104. package/Libraries/Image/Image.android.js +8 -2
  105. package/Libraries/Image/Image.d.ts +1 -1
  106. package/Libraries/Image/Image.ios.js +4 -1
  107. package/Libraries/Image/Image.win32.js +6 -3
  108. package/Libraries/Image/ImageBackground.js +3 -0
  109. package/Libraries/Image/resolveAssetSource.win32.js +1 -1
  110. package/Libraries/Inspector/DevtoolsOverlay.js +6 -3
  111. package/Libraries/Inspector/NetworkOverlay.js +2 -2
  112. package/Libraries/Interaction/JSEventLoopWatchdog.js +1 -5
  113. package/Libraries/Interaction/PanResponder.js +1 -4
  114. package/Libraries/IntersectionObserver/IntersectionObserver.js +252 -0
  115. package/Libraries/IntersectionObserver/IntersectionObserverEntry.js +140 -0
  116. package/Libraries/IntersectionObserver/IntersectionObserverManager.js +221 -0
  117. package/Libraries/IntersectionObserver/NativeIntersectionObserver.js +41 -0
  118. package/Libraries/IntersectionObserver/__mocks__/NativeIntersectionObserver.js +162 -0
  119. package/Libraries/LayoutAnimation/LayoutAnimation.js +1 -1
  120. package/Libraries/Lists/FlatList.d.ts +2 -1
  121. package/Libraries/Lists/FlatList.js +15 -5
  122. package/Libraries/Lists/SectionList.js +4 -0
  123. package/Libraries/LogBox/Data/LogBoxLog.js +4 -1
  124. package/Libraries/LogBox/Data/LogBoxSymbolication.js +5 -2
  125. package/Libraries/LogBox/Data/parseLogBoxLog.js +57 -20
  126. package/Libraries/LogBox/UI/AnsiHighlight.js +1 -1
  127. package/Libraries/LogBox/UI/LogBoxInspectorFooter.js +24 -31
  128. package/Libraries/LogBox/UI/LogBoxInspectorHeader.js +1 -1
  129. package/Libraries/LogBox/UI/LogBoxMessage.js +4 -7
  130. package/Libraries/MutationObserver/MutationObserver.js +184 -0
  131. package/Libraries/MutationObserver/MutationObserverManager.js +218 -0
  132. package/Libraries/MutationObserver/MutationRecord.js +82 -0
  133. package/Libraries/MutationObserver/NativeMutationObserver.js +58 -0
  134. package/Libraries/MutationObserver/__mocks__/NativeMutationObserver.js +327 -0
  135. package/Libraries/NativeComponent/BaseViewConfig.android.js +18 -3
  136. package/Libraries/NativeComponent/BaseViewConfig.ios.js +33 -0
  137. package/Libraries/NativeComponent/BaseViewConfig.win32.js +33 -0
  138. package/Libraries/NativeComponent/NativeComponentRegistry.js +3 -5
  139. package/Libraries/NativeModules/specs/NativeSourceCode.js +6 -6
  140. package/Libraries/Network/RCTNetworking.android.js +2 -1
  141. package/Libraries/Network/XMLHttpRequest.js +1 -1
  142. package/Libraries/NewAppScreen/components/DebugInstructions.js +4 -4
  143. package/Libraries/NewAppScreen/components/LearnMoreLinks.js +9 -2
  144. package/Libraries/Performance/QuickPerformanceLogger.js +1 -1
  145. package/Libraries/PermissionsAndroid/NativePermissionsAndroid.js +1 -0
  146. package/Libraries/PermissionsAndroid/PermissionsAndroid.d.ts +1 -0
  147. package/Libraries/PermissionsAndroid/PermissionsAndroid.js +3 -1
  148. package/Libraries/Pressability/Pressability.js +28 -3
  149. package/Libraries/Pressability/Pressability.win32.js +30 -5
  150. package/Libraries/ReactNative/AppContainer.js +2 -3
  151. package/Libraries/ReactNative/AppRegistry.d.ts +0 -5
  152. package/Libraries/ReactNative/AppRegistry.js +66 -53
  153. package/Libraries/ReactNative/BridgelessUIManager.js +38 -9
  154. package/Libraries/ReactNative/FabricUIManager.js +143 -34
  155. package/Libraries/ReactNative/I18nManager.js +5 -11
  156. package/Libraries/ReactNative/NativeI18nManager.js +7 -5
  157. package/Libraries/ReactNative/PaperUIManager.win32.js +2 -2
  158. package/Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricHostComponent.js +151 -0
  159. package/Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricPublicInstance.js +81 -0
  160. package/Libraries/ReactNative/ReactFabricPublicInstance/ReactNativeAttributePayload.js +492 -0
  161. package/Libraries/ReactNative/ReactFabricPublicInstance/warnForStyleProps.js +32 -0
  162. package/Libraries/ReactNative/ReactNativeFeatureFlags.js +19 -3
  163. package/Libraries/ReactNative/UIManager.js +8 -0
  164. package/Libraries/ReactNative/__mocks__/FabricUIManager.js +648 -0
  165. package/Libraries/ReactPrivate/ReactNativePrivateInterface.js +38 -2
  166. package/Libraries/Renderer/implementations/ReactFabric-dev.js +27 -27
  167. package/Libraries/Renderer/implementations/ReactFabric-prod.js +3 -3
  168. package/Libraries/Renderer/implementations/ReactFabric-profiling.js +3 -3
  169. package/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js +27 -27
  170. package/Libraries/Renderer/implementations/ReactNativeRenderer-prod.js +3 -3
  171. package/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.js +3 -3
  172. package/Libraries/Renderer/shims/ReactFabric.js +5 -6
  173. package/Libraries/Renderer/shims/ReactFeatureFlags.js +2 -3
  174. package/Libraries/Renderer/shims/ReactNative.js +2 -3
  175. package/Libraries/Renderer/shims/ReactNativeTypes.js +35 -17
  176. package/Libraries/Renderer/shims/ReactNativeViewConfigRegistry.js +3 -3
  177. package/Libraries/Renderer/shims/createReactNativeComponentClass.js +2 -3
  178. package/Libraries/Settings/{Settings.android.js → Settings.js} +4 -4
  179. package/Libraries/Share/Share.d.ts +3 -9
  180. package/Libraries/StyleSheet/PlatformColorValueTypes.android.js +9 -4
  181. package/Libraries/StyleSheet/PlatformColorValueTypes.ios.js +28 -13
  182. package/Libraries/StyleSheet/PlatformColorValueTypes.win32.js +14 -4
  183. package/Libraries/StyleSheet/PlatformColorValueTypesIOS.ios.js +1 -1
  184. package/Libraries/StyleSheet/PlatformColorValueTypesWin32.d.ts +1 -1
  185. package/Libraries/StyleSheet/StyleSheet.d.ts +10 -1
  186. package/Libraries/StyleSheet/StyleSheet.js +3 -0
  187. package/Libraries/StyleSheet/StyleSheet.win32.js +3 -0
  188. package/Libraries/StyleSheet/StyleSheetTypes.d.ts +31 -17
  189. package/Libraries/StyleSheet/StyleSheetTypes.js +90 -6
  190. package/Libraries/StyleSheet/flattenStyle.js +4 -0
  191. package/Libraries/StyleSheet/private/_TransformStyle.js +16 -2
  192. package/Libraries/StyleSheet/processColor.js +1 -2
  193. package/Libraries/StyleSheet/processTransformOrigin.js +136 -0
  194. package/Libraries/StyleSheet/splitLayoutProps.js +1 -0
  195. package/Libraries/Text/Text.d.ts +5 -5
  196. package/Libraries/Text/Text.js +17 -10
  197. package/Libraries/Text/Text.win32.js +354 -0
  198. package/Libraries/Text/TextProps.win32.js +281 -0
  199. package/Libraries/TurboModule/TurboModuleRegistry.js +47 -7
  200. package/Libraries/TurboModule/samples/NativeSampleTurboModule.js +6 -0
  201. package/Libraries/Types/CoreEventTypes.d.ts +5 -2
  202. package/Libraries/Utilities/GlobalPerformanceLogger.js +2 -12
  203. package/Libraries/Utilities/NativeDeviceInfo.js +8 -9
  204. package/Libraries/Utilities/NativePlatformConstantsAndroid.js +23 -18
  205. package/Libraries/Utilities/NativePlatformConstantsIOS.js +16 -13
  206. package/Libraries/Utilities/NativePlatformConstantsWin.js +13 -10
  207. package/Libraries/Utilities/PerformanceLoggerContext.js +1 -1
  208. package/Libraries/Utilities/Platform.android.js +12 -8
  209. package/Libraries/Utilities/Platform.d.ts +1 -0
  210. package/Libraries/Utilities/Platform.flow.js +84 -0
  211. package/Libraries/Utilities/Platform.flow.win32.js +111 -0
  212. package/Libraries/Utilities/Platform.ios.js +12 -8
  213. package/Libraries/Utilities/Platform.win32.js +12 -8
  214. package/Libraries/Utilities/PolyfillFunctions.js +1 -1
  215. package/Libraries/Utilities/ReactNativeTestTools.js +1 -2
  216. package/Libraries/Utilities/SceneTracker.js +1 -1
  217. package/Libraries/Utilities/createPerformanceLogger.js +63 -32
  218. package/Libraries/Utilities/useColorScheme.js +7 -8
  219. package/Libraries/WebPerformance/MemoryInfo.js +1 -1
  220. package/Libraries/WebPerformance/NativePerformance.js +3 -8
  221. package/Libraries/WebPerformance/NativePerformanceObserver.js +4 -0
  222. package/Libraries/WebPerformance/Performance.js +42 -15
  223. package/Libraries/WebPerformance/PerformanceEntry.js +14 -6
  224. package/Libraries/WebPerformance/PerformanceEventTiming.js +18 -1
  225. package/Libraries/WebPerformance/ReactNativeStartupTiming.js +40 -14
  226. package/Libraries/WebPerformance/__mocks__/NativePerformance.js +4 -2
  227. package/Libraries/WebPerformance/__mocks__/NativePerformanceObserver.js +21 -3
  228. package/Libraries/promiseRejectionTrackingOptions.js +1 -3
  229. package/Libraries/vendor/emitter/EventEmitter.js +17 -17
  230. package/flow/global.js +1 -3
  231. package/flow/jest.js +5 -1
  232. package/{Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.ios.js → jest/ReactNativeInternalFeatureFlagsMock.js} +2 -1
  233. package/jest/__tests__/setup-test.js +18 -0
  234. package/jest/mockModal.js +6 -4
  235. package/jest/setup.js +61 -30
  236. package/jest.config.js +1 -1
  237. package/just-task.js +1 -0
  238. package/overrides.json +51 -46
  239. package/package.json +35 -33
  240. package/src/Libraries/Components/Button/ButtonWin32.Props.ts +1 -1
  241. package/src/Libraries/Components/Button/ButtonWin32.tsx +0 -2
  242. package/src/Libraries/Components/Touchable/Tests/TouchableWin32Test.tsx +2 -2
  243. package/src/Libraries/Components/Touchable/TouchableWin32.tsx +1 -1
  244. package/src/Libraries/Components/View/ViewAccessibility.d.ts +8 -2
  245. package/src/Libraries/StyleSheet/PlatformColorValueTypesWin32.d.ts +1 -1
  246. package/types/experimental.d.ts +44 -0
  247. package/types/index.d.ts +2 -1
  248. package/types/modules/Devtools.d.ts +1 -0
  249. package/types/modules/globals.d.ts +16 -1
  250. package/IntegrationTests/BUCK +0 -32
  251. package/IntegrationTests/PropertiesUpdateTest.js +0 -29
  252. package/IntegrationTests/RCTRootViewIntegrationTestApp.js +0 -86
  253. package/IntegrationTests/ReactContentSizeUpdateTest.js +0 -89
  254. package/IntegrationTests/SizeFlexibilityUpdateTest.js +0 -106
  255. package/Libraries/Components/TextInput/TextInput.Types.win32.d.ts +0 -51
  256. package/Libraries/Components/TextInput/TextInput.Types.win32.js +0 -3
  257. package/Libraries/Components/TextInput/TextInput.Types.win32.js.map +0 -1
  258. package/Libraries/Utilities/AcessibilityMapping.js +0 -154
  259. package/Libraries/Utilities/AcessibilityMapping.win32.js +0 -156
  260. package/Libraries/Utilities/NativeDevSplitBundleLoader.js +0 -19
  261. package/Libraries/Utilities/useColorScheme.win32.js +0 -26
  262. package/flow/use-sync-external-store.js +0 -20
  263. package/flow-typed/npm/base64-js_v1.x.x.js +0 -12
  264. package/flow-typed/npm/glob_v7.x.x.js +0 -79
  265. package/flow-typed/npm/pretty-format_v26.x.x.js +0 -49
  266. package/flow-typed/npm/promise_v8.x.x.js +0 -30
  267. package/flow-typed/npm/react-dom_v17.x.x.js +0 -139
  268. package/flow-typed/npm/react-test-renderer_v16.x.x.js +0 -79
  269. package/flow-typed/npm/stacktrace-parser_v0.1.x.js +0 -17
  270. package/flow-typed/npm/yargs_v17.x.x.js +0 -341
  271. package/src/Libraries/Components/TextInput/TextInput.Types.win32.ts +0 -68
  272. /package/Libraries/{Renderer/public → ReactNative/ReactFabricPublicInstance}/ReactFabricPublicInstanceUtils.js +0 -0
@@ -221,6 +221,14 @@ export default class SpringAnimation extends Animation {
221
221
  }
222
222
 
223
223
  const start = () => {
224
+ if (!this._useNativeDriver && animatedValue.__isNative === true) {
225
+ throw new Error(
226
+ 'Attempting to run JS driven animation on animated node ' +
227
+ 'that has been moved to "native" earlier by starting an ' +
228
+ 'animation with `useNativeDriver: true`',
229
+ );
230
+ }
231
+
224
232
  if (this._useNativeDriver) {
225
233
  this.__startNativeAnimation(animatedValue);
226
234
  } else {
@@ -112,6 +112,14 @@ export default class TimingAnimation extends Animation {
112
112
  this.__onEnd = onEnd;
113
113
 
114
114
  const start = () => {
115
+ if (!this._useNativeDriver && animatedValue.__isNative === true) {
116
+ throw new Error(
117
+ 'Attempting to run JS driven animation on animated node ' +
118
+ 'that has been moved to "native" earlier by starting an ' +
119
+ 'animation with `useNativeDriver: true`',
120
+ );
121
+ }
122
+
115
123
  // Animations that sometimes have 0 duration and sometimes do not
116
124
  // still need to use the native driver when duration is 0 so as to
117
125
  // not cause intermixed JS and native animations.
@@ -18,12 +18,13 @@ import * as React from 'react';
18
18
  * @see https://github.com/facebook/react-native/commit/b8c8562
19
19
  */
20
20
  const FlatListWithEventThrottle = React.forwardRef(
21
+ // $FlowFixMe[incompatible-call]
21
22
  (
22
23
  props: React.ElementConfig<typeof FlatList>,
23
24
  ref:
24
25
  | ((null | FlatList<mixed>) => mixed)
25
26
  | {current: null | FlatList<mixed>, ...},
26
- ) => <FlatList scrollEventThrottle={0.0001} {...props} ref={ref} />,
27
+ ) => <FlatList {...props} ref={ref} />,
27
28
  );
28
29
 
29
30
  export default (createAnimatedComponent(
@@ -61,6 +61,7 @@ const AnimatedScrollView: AnimatedComponentType<Props, Instance> =
61
61
  });
62
62
 
63
63
  const AnimatedScrollViewWithInvertedRefreshControl = React.forwardRef(
64
+ // $FlowFixMe[incompatible-call]
64
65
  (
65
66
  props: {
66
67
  ...React.ElementConfig<typeof ScrollView>,
@@ -76,6 +77,7 @@ const AnimatedScrollViewWithInvertedRefreshControl = React.forwardRef(
76
77
  const {intermediatePropsForRefreshControl, intermediatePropsForScrollView} =
77
78
  useMemo(() => {
78
79
  // $FlowFixMe[underconstrained-implicit-instantiation]
80
+ // $FlowFixMe[incompatible-call]
79
81
  const {outer, inner} = splitLayoutProps(flattenStyle(props.style));
80
82
  return {
81
83
  intermediatePropsForRefreshControl: {style: outer},
@@ -19,6 +19,7 @@ import * as React from 'react';
19
19
  * @see https://github.com/facebook/react-native/commit/b8c8562
20
20
  */
21
21
  const SectionListWithEventThrottle = React.forwardRef(
22
+ // $FlowFixMe[incompatible-call]
22
23
  (
23
24
  props: React.ElementConfig<typeof SectionList>,
24
25
  ref:
@@ -27,7 +28,7 @@ const SectionListWithEventThrottle = React.forwardRef(
27
28
  current: null | SectionList<SectionBase<$FlowFixMe>>,
28
29
  ...
29
30
  },
30
- ) => <SectionList scrollEventThrottle={0.0001} {...props} ref={ref} />,
31
+ ) => <SectionList {...props} ref={ref} />,
31
32
  );
32
33
 
33
34
  export default (createAnimatedComponent(
@@ -37,6 +37,7 @@ export default function createAnimatedComponent<TProps: {...}, TInstance>(
37
37
  // $FlowFixMe[incompatible-call]
38
38
  props,
39
39
  );
40
+ // $FlowFixMe[incompatible-call]
40
41
  const ref = useMergeRefs<TInstance | null>(callbackRef, forwardedRef);
41
42
 
42
43
  // Some components require explicit passthrough values for animation
@@ -10,9 +10,9 @@
10
10
 
11
11
  'use strict';
12
12
 
13
- import type {NativeColorValue} from '../../StyleSheet/PlatformColorValueTypes';
14
13
  import type {ProcessedColorValue} from '../../StyleSheet/processColor';
15
14
  import type {ColorValue} from '../../StyleSheet/StyleSheet';
15
+ import type {NativeColorValue} from '../../StyleSheet/StyleSheetTypes';
16
16
  import type {PlatformConfig} from '../AnimatedPlatformConfig';
17
17
 
18
18
  import normalizeColor from '../../StyleSheet/normalizeColor';
@@ -0,0 +1,146 @@
1
+ /**
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ * @flow
8
+ * @format
9
+ * @oncall react_native
10
+ */
11
+
12
+ 'use strict';
13
+
14
+ import type {PlatformConfig} from '../AnimatedPlatformConfig';
15
+
16
+ import AnimatedNode from './AnimatedNode';
17
+ import AnimatedWithChildren from './AnimatedWithChildren';
18
+ import * as React from 'react';
19
+
20
+ const MAX_DEPTH = 5;
21
+
22
+ function isPlainObject(value: any): boolean {
23
+ return (
24
+ value !== null &&
25
+ typeof value === 'object' &&
26
+ Object.getPrototypeOf(value).isPrototypeOf(Object)
27
+ );
28
+ }
29
+
30
+ // Recurse through values, executing fn for any AnimatedNodes
31
+ function visit(value: any, fn: any => void, depth: number = 0): void {
32
+ if (depth >= MAX_DEPTH) {
33
+ return;
34
+ }
35
+
36
+ if (value instanceof AnimatedNode) {
37
+ fn(value);
38
+ } else if (Array.isArray(value)) {
39
+ value.forEach(element => {
40
+ visit(element, fn, depth + 1);
41
+ });
42
+ } else if (isPlainObject(value)) {
43
+ Object.values(value).forEach(element => {
44
+ visit(element, fn, depth + 1);
45
+ });
46
+ }
47
+ }
48
+
49
+ // Returns a copy of value with a transformation fn applied to any AnimatedNodes
50
+ function mapAnimatedNodes(value: any, fn: any => any, depth: number = 0): any {
51
+ if (depth >= MAX_DEPTH) {
52
+ return value;
53
+ }
54
+
55
+ if (value instanceof AnimatedNode) {
56
+ return fn(value);
57
+ } else if (Array.isArray(value)) {
58
+ return value.map(element => mapAnimatedNodes(element, fn, depth + 1));
59
+ } else if (isPlainObject(value)) {
60
+ const result: {[string]: any} = {};
61
+ for (const key in value) {
62
+ result[key] = mapAnimatedNodes(value[key], fn, depth + 1);
63
+ }
64
+ return result;
65
+ } else {
66
+ return value;
67
+ }
68
+ }
69
+
70
+ export function hasAnimatedNode(value: any, depth: number = 0): boolean {
71
+ if (depth >= MAX_DEPTH) {
72
+ return false;
73
+ }
74
+
75
+ if (value instanceof AnimatedNode) {
76
+ return true;
77
+ } else if (Array.isArray(value)) {
78
+ for (const element of value) {
79
+ if (hasAnimatedNode(element, depth + 1)) {
80
+ return true;
81
+ }
82
+ }
83
+ } else if (isPlainObject(value)) {
84
+ // Don't consider React elements
85
+ if (React.isValidElement(value)) {
86
+ return false;
87
+ }
88
+ for (const key in value) {
89
+ if (hasAnimatedNode(value[key], depth + 1)) {
90
+ return true;
91
+ }
92
+ }
93
+ }
94
+ return false;
95
+ }
96
+
97
+ export default class AnimatedObject extends AnimatedWithChildren {
98
+ _value: any;
99
+
100
+ constructor(value: any) {
101
+ super();
102
+ this._value = value;
103
+ }
104
+
105
+ __getValue(): any {
106
+ return mapAnimatedNodes(this._value, node => {
107
+ return node.__getValue();
108
+ });
109
+ }
110
+
111
+ __getAnimatedValue(): any {
112
+ return mapAnimatedNodes(this._value, node => {
113
+ return node.__getAnimatedValue();
114
+ });
115
+ }
116
+
117
+ __attach(): void {
118
+ super.__attach();
119
+ visit(this._value, node => {
120
+ node.__addChild(this);
121
+ });
122
+ }
123
+
124
+ __detach(): void {
125
+ visit(this._value, node => {
126
+ node.__removeChild(this);
127
+ });
128
+ super.__detach();
129
+ }
130
+
131
+ __makeNative(platformConfig: ?PlatformConfig): void {
132
+ visit(this._value, value => {
133
+ value.__makeNative(platformConfig);
134
+ });
135
+ super.__makeNative(platformConfig);
136
+ }
137
+
138
+ __getNativeConfig(): any {
139
+ return {
140
+ type: 'object',
141
+ value: mapAnimatedNodes(this._value, node => {
142
+ return {nodeTag: node.__getNativeTag()};
143
+ }),
144
+ };
145
+ }
146
+ }
@@ -16,9 +16,27 @@ import {findNodeHandle} from '../../ReactNative/RendererProxy';
16
16
  import {AnimatedEvent} from '../AnimatedEvent';
17
17
  import NativeAnimatedHelper from '../NativeAnimatedHelper';
18
18
  import AnimatedNode from './AnimatedNode';
19
+ import AnimatedObject, {hasAnimatedNode} from './AnimatedObject';
19
20
  import AnimatedStyle from './AnimatedStyle';
20
21
  import invariant from 'invariant';
21
22
 
23
+ function createAnimatedProps(inputProps: Object): Object {
24
+ const props: Object = {};
25
+ for (const key in inputProps) {
26
+ const value = inputProps[key];
27
+ if (key === 'style') {
28
+ props[key] = new AnimatedStyle(value);
29
+ } else if (value instanceof AnimatedNode) {
30
+ props[key] = value;
31
+ } else if (hasAnimatedNode(value)) {
32
+ props[key] = new AnimatedObject(value);
33
+ } else {
34
+ props[key] = value;
35
+ }
36
+ }
37
+ return props;
38
+ }
39
+
22
40
  export default class AnimatedProps extends AnimatedNode {
23
41
  _props: Object;
24
42
  _animatedView: any;
@@ -26,13 +44,7 @@ export default class AnimatedProps extends AnimatedNode {
26
44
 
27
45
  constructor(props: Object, callback: () => void) {
28
46
  super();
29
- if (props.style) {
30
- props = {
31
- ...props,
32
- style: new AnimatedStyle(props.style),
33
- };
34
- }
35
- this._props = props;
47
+ this._props = createAnimatedProps(props);
36
48
  this._callback = callback;
37
49
  }
38
50
 
@@ -12,99 +12,73 @@
12
12
 
13
13
  import type {PlatformConfig} from '../AnimatedPlatformConfig';
14
14
 
15
+ import ReactNativeFeatureFlags from '../../ReactNative/ReactNativeFeatureFlags';
15
16
  import flattenStyle from '../../StyleSheet/flattenStyle';
16
17
  import Platform from '../../Utilities/Platform';
17
18
  import NativeAnimatedHelper from '../NativeAnimatedHelper';
18
19
  import AnimatedNode from './AnimatedNode';
20
+ import AnimatedObject, {hasAnimatedNode} from './AnimatedObject';
19
21
  import AnimatedTransform from './AnimatedTransform';
20
22
  import AnimatedWithChildren from './AnimatedWithChildren';
21
23
 
22
- function createAnimatedStyle(inputStyle: any): Object {
24
+ function createAnimatedStyle(
25
+ inputStyle: any,
26
+ keepUnanimatedValues: boolean,
27
+ ): Object {
23
28
  // $FlowFixMe[underconstrained-implicit-instantiation]
24
29
  const style = flattenStyle(inputStyle);
25
30
  const animatedStyles: any = {};
26
31
  for (const key in style) {
27
32
  const value = style[key];
28
33
  if (key === 'transform') {
29
- animatedStyles[key] = new AnimatedTransform(value);
34
+ animatedStyles[key] =
35
+ ReactNativeFeatureFlags.shouldUseAnimatedObjectForTransform()
36
+ ? new AnimatedObject(value)
37
+ : new AnimatedTransform(value);
30
38
  } else if (value instanceof AnimatedNode) {
31
39
  animatedStyles[key] = value;
32
- } else if (value && !Array.isArray(value) && typeof value === 'object') {
33
- animatedStyles[key] = createAnimatedStyle(value);
40
+ } else if (hasAnimatedNode(value)) {
41
+ animatedStyles[key] = new AnimatedObject(value);
42
+ } else if (keepUnanimatedValues) {
43
+ animatedStyles[key] = value;
34
44
  }
35
45
  }
36
46
  return animatedStyles;
37
47
  }
38
48
 
39
- function createStyleWithAnimatedTransform(inputStyle: any): Object {
40
- // $FlowFixMe[underconstrained-implicit-instantiation]
41
- let style = flattenStyle(inputStyle) || ({}: {[string]: any});
42
-
43
- if (style.transform) {
44
- style = {
45
- ...style,
46
- transform: new AnimatedTransform(style.transform),
47
- };
48
- }
49
- return style;
50
- }
51
-
52
49
  export default class AnimatedStyle extends AnimatedWithChildren {
53
50
  _inputStyle: any;
54
51
  _style: Object;
55
52
 
56
53
  constructor(style: any) {
57
54
  super();
58
- if (Platform.OS === 'web') {
59
- this._inputStyle = style;
60
- this._style = createAnimatedStyle(style);
61
- } else {
62
- this._style = createStyleWithAnimatedTransform(style);
63
- }
55
+ this._inputStyle = style;
56
+ this._style = createAnimatedStyle(style, Platform.OS !== 'web');
64
57
  }
65
58
 
66
- // Recursively get values for nested styles (like iOS's shadowOffset)
67
- _walkStyleAndGetValues(style: any): {[string]: any | {...}} {
68
- const updatedStyle: {[string]: any | {...}} = {};
69
- for (const key in style) {
70
- const value = style[key];
59
+ __getValue(): Object | Array<Object> {
60
+ const result: {[string]: any} = {};
61
+ for (const key in this._style) {
62
+ const value = this._style[key];
71
63
  if (value instanceof AnimatedNode) {
72
- updatedStyle[key] = value.__getValue();
73
- } else if (value && !Array.isArray(value) && typeof value === 'object') {
74
- // Support animating nested values (for example: shadowOffset.height)
75
- updatedStyle[key] = this._walkStyleAndGetValues(value);
64
+ result[key] = value.__getValue();
76
65
  } else {
77
- updatedStyle[key] = value;
66
+ result[key] = value;
78
67
  }
79
68
  }
80
- return updatedStyle;
81
- }
82
69
 
83
- __getValue(): Object | Array<Object> {
84
- if (Platform.OS === 'web') {
85
- return [this._inputStyle, this._walkStyleAndGetValues(this._style)];
86
- }
87
-
88
- return this._walkStyleAndGetValues(this._style);
70
+ return Platform.OS === 'web' ? [this._inputStyle, result] : result;
89
71
  }
90
72
 
91
- // Recursively get animated values for nested styles (like iOS's shadowOffset)
92
- _walkStyleAndGetAnimatedValues(style: any): {[string]: any | {...}} {
93
- const updatedStyle: {[string]: any | {...}} = {};
94
- for (const key in style) {
95
- const value = style[key];
73
+ __getAnimatedValue(): Object {
74
+ const result: {[string]: any} = {};
75
+ for (const key in this._style) {
76
+ const value = this._style[key];
96
77
  if (value instanceof AnimatedNode) {
97
- updatedStyle[key] = value.__getAnimatedValue();
98
- } else if (value && !Array.isArray(value) && typeof value === 'object') {
99
- // Support animating nested values (for example: shadowOffset.height)
100
- updatedStyle[key] = this._walkStyleAndGetAnimatedValues(value);
78
+ result[key] = value.__getAnimatedValue();
101
79
  }
102
80
  }
103
- return updatedStyle;
104
- }
105
-
106
- __getAnimatedValue(): Object {
107
- return this._walkStyleAndGetAnimatedValues(this._style);
81
+ return result;
108
82
  }
109
83
 
110
84
  __attach(): void {
@@ -19,11 +19,7 @@ import invariant from 'invariant';
19
19
  export type AnimatedValueXYConfig = $ReadOnly<{
20
20
  useNativeDriver: boolean,
21
21
  }>;
22
- type ValueXYListenerCallback = (value: {
23
- x: number,
24
- y: number,
25
- ...
26
- }) => mixed;
22
+ type ValueXYListenerCallback = (value: {x: number, y: number, ...}) => mixed;
27
23
 
28
24
  let _uniqueId = 1;
29
25
 
@@ -135,11 +131,7 @@ export default class AnimatedValueXY extends AnimatedWithChildren {
135
131
  * See https://reactnative.dev/docs/animatedvaluexy#resetanimation
136
132
  */
137
133
  resetAnimation(
138
- callback?: (value: {
139
- x: number,
140
- y: number,
141
- ...
142
- }) => void,
134
+ callback?: (value: {x: number, y: number, ...}) => void,
143
135
  ): void {
144
136
  this.x.resetAnimation();
145
137
  this.y.resetAnimation();
@@ -153,13 +145,7 @@ export default class AnimatedValueXY extends AnimatedWithChildren {
153
145
  *
154
146
  * See https://reactnative.dev/docs/animatedvaluexy#stopanimation
155
147
  */
156
- stopAnimation(
157
- callback?: (value: {
158
- x: number,
159
- y: number,
160
- ...
161
- }) => void,
162
- ): void {
148
+ stopAnimation(callback?: (value: {x: number, y: number, ...}) => void): void {
163
149
  this.x.stopAnimation();
164
150
  this.y.stopAnimation();
165
151
  callback && callback(this.__getValue());
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ * @flow
8
+ * @format
9
+ */
10
+
11
+ import Platform from '../Utilities/Platform';
12
+
13
+ function shouldUseTurboAnimatedModule(): boolean {
14
+ return Platform.OS === 'ios' && global.RN$Bridgeless === true;
15
+ }
16
+
17
+ export default shouldUseTurboAnimatedModule;
@@ -10,7 +10,8 @@
10
10
 
11
11
  'use strict';
12
12
 
13
- import {isPublicInstance as isFabricPublicInstance} from '../Renderer/public/ReactFabricPublicInstanceUtils';
13
+ import {isPublicInstance as isFabricPublicInstance} from '../ReactNative/ReactFabricPublicInstance/ReactFabricPublicInstanceUtils';
14
+ import ReactNativeFeatureFlags from '../ReactNative/ReactNativeFeatureFlags';
14
15
  import useRefEffect from '../Utilities/useRefEffect';
15
16
  import {AnimatedEvent} from './AnimatedEvent';
16
17
  import NativeAnimatedHelper from './NativeAnimatedHelper';
@@ -45,6 +46,8 @@ export default function useAnimatedProps<TProps: {...}, TInstance>(
45
46
  () => new AnimatedProps(props, () => onUpdateRef.current?.()),
46
47
  [props],
47
48
  );
49
+ const useNativePropsInFabric =
50
+ ReactNativeFeatureFlags.shouldUseSetNativePropsInFabric();
48
51
  useAnimatedPropsLifecycle(node);
49
52
 
50
53
  // TODO: This "effect" does three things:
@@ -66,13 +69,15 @@ export default function useAnimatedProps<TProps: {...}, TInstance>(
66
69
  // changes), but `setNativeView` already optimizes for that.
67
70
  node.setNativeView(instance);
68
71
 
69
- // NOTE: This callback is only used by the JavaScript animation driver.
72
+ // NOTE: When using the JS animation driver, this callback is called on
73
+ // every animation frame. When using the native driver, this callback is
74
+ // called when the animation completes.
70
75
  onUpdateRef.current = () => {
71
76
  if (
72
77
  process.env.NODE_ENV === 'test' ||
73
78
  typeof instance !== 'object' ||
74
79
  typeof instance?.setNativeProps !== 'function' ||
75
- isFabricInstance(instance)
80
+ (isFabricInstance(instance) && !useNativePropsInFabric)
76
81
  ) {
77
82
  // Schedule an update for this component to update `reducedProps`,
78
83
  // but do not compute it immediately. If a parent also updated, we
@@ -82,12 +87,6 @@ export default function useAnimatedProps<TProps: {...}, TInstance>(
82
87
  // $FlowIgnore[not-a-function] - Assume it's still a function.
83
88
  // $FlowFixMe[incompatible-use]
84
89
  instance.setNativeProps(node.__getAnimatedValue());
85
- } else {
86
- throw new Error(
87
- 'Attempting to run JS driven animation on animated node ' +
88
- 'that has been moved to "native" earlier by starting an ' +
89
- 'animation with `useNativeDriver: true`',
90
- );
91
90
  }
92
91
  };
93
92
 
@@ -110,7 +109,7 @@ export default function useAnimatedProps<TProps: {...}, TInstance>(
110
109
  }
111
110
  };
112
111
  },
113
- [props, node],
112
+ [props, node, useNativePropsInFabric],
114
113
  );
115
114
  const callbackRef = useRefEffect<TInstance>(refEffect);
116
115
 
@@ -24,7 +24,7 @@ import {NativeEventSubscription} from '../EventEmitter/RCTNativeAppEventEmitter'
24
24
  * App States
25
25
  * active - The app is running in the foreground
26
26
  * background - The app is running in the background. The user is either in another app or on the home screen
27
- * inactive [iOS] - This is a transition state that currently never happens for typical React Native apps.
27
+ * inactive [iOS] - This is a transition state that happens when the app launches, is asking for permissions or when a call or SMS message is received.
28
28
  * unknown [iOS] - Initial value until the current app state is determined
29
29
  * extension [iOS] - The app is running as an app extension
30
30
  *
@@ -12,12 +12,16 @@ import type {TurboModule} from '../TurboModule/RCTExport';
12
12
 
13
13
  import * as TurboModuleRegistry from '../TurboModule/TurboModuleRegistry';
14
14
 
15
+ export type AppStateConstants = {|
16
+ initialAppState: string,
17
+ |};
18
+
19
+ export type AppState = {|app_state: string|};
20
+
15
21
  export interface Spec extends TurboModule {
16
- +getConstants: () => {|
17
- initialAppState: string,
18
- |};
22
+ +getConstants: () => AppStateConstants;
19
23
  +getCurrentAppState: (
20
- success: (appState: {|app_state: string|}) => void,
24
+ success: (appState: AppState) => void,
21
25
  error: (error: Object) => void,
22
26
  ) => void;
23
27
 
@@ -388,10 +388,13 @@ class MessageQueue {
388
388
 
389
389
  __callReactNativeMicrotasks() {
390
390
  Systrace.beginEvent('JSTimers.callReactNativeMicrotasks()');
391
- if (this._reactNativeMicrotasksCallback != null) {
392
- this._reactNativeMicrotasksCallback();
391
+ try {
392
+ if (this._reactNativeMicrotasksCallback != null) {
393
+ this._reactNativeMicrotasksCallback();
394
+ }
395
+ } finally {
396
+ Systrace.endEvent();
393
397
  }
394
- Systrace.endEvent();
395
398
  }
396
399
 
397
400
  __callFunction(module: string, method: string, args: mixed[]): void {
@@ -402,31 +405,35 @@ class MessageQueue {
402
405
  } else {
403
406
  Systrace.beginEvent(`${module}.${method}(...)`);
404
407
  }
405
- if (this.__spy) {
406
- this.__spy({type: TO_JS, module, method, args});
407
- }
408
- const moduleMethods = this.getCallableModule(module);
409
- if (!moduleMethods) {
410
- const callableModuleNames = Object.keys(this._lazyCallableModules);
411
- const n = callableModuleNames.length;
412
- const callableModuleNameList = callableModuleNames.join(', ');
413
-
414
- // TODO(T122225939): Remove after investigation: Why are we getting to this line in bridgeless mode?
415
- const isBridgelessMode = global.RN$Bridgeless === true ? 'true' : 'false';
416
- invariant(
417
- false,
418
- `Failed to call into JavaScript module method ${module}.${method}(). Module has not been registered as callable. Bridgeless Mode: ${isBridgelessMode}. Registered callable JavaScript modules (n = ${n}): ${callableModuleNameList}.
419
- A frequent cause of the error is that the application entry file path is incorrect. This can also happen when the JS bundle is corrupt or there is an early initialization error when loading React Native.`,
420
- );
421
- }
422
- if (!moduleMethods[method]) {
423
- invariant(
424
- false,
425
- `Failed to call into JavaScript module method ${module}.${method}(). Module exists, but the method is undefined.`,
426
- );
408
+ try {
409
+ if (this.__spy) {
410
+ this.__spy({type: TO_JS, module, method, args});
411
+ }
412
+ const moduleMethods = this.getCallableModule(module);
413
+ if (!moduleMethods) {
414
+ const callableModuleNames = Object.keys(this._lazyCallableModules);
415
+ const n = callableModuleNames.length;
416
+ const callableModuleNameList = callableModuleNames.join(', ');
417
+
418
+ // TODO(T122225939): Remove after investigation: Why are we getting to this line in bridgeless mode?
419
+ const isBridgelessMode =
420
+ global.RN$Bridgeless === true ? 'true' : 'false';
421
+ invariant(
422
+ false,
423
+ `Failed to call into JavaScript module method ${module}.${method}(). Module has not been registered as callable. Bridgeless Mode: ${isBridgelessMode}. Registered callable JavaScript modules (n = ${n}): ${callableModuleNameList}.
424
+ A frequent cause of the error is that the application entry file path is incorrect. This can also happen when the JS bundle is corrupt or there is an early initialization error when loading React Native.`,
425
+ );
426
+ }
427
+ if (!moduleMethods[method]) {
428
+ invariant(
429
+ false,
430
+ `Failed to call into JavaScript module method ${module}.${method}(). Module exists, but the method is undefined.`,
431
+ );
432
+ }
433
+ moduleMethods[method].apply(moduleMethods, args);
434
+ } finally {
435
+ Systrace.endEvent();
427
436
  }
428
- moduleMethods[method].apply(moduleMethods, args);
429
- Systrace.endEvent();
430
437
  }
431
438
 
432
439
  __invokeCallback(cbID: number, args: mixed[]): void {
@@ -465,16 +472,18 @@ class MessageQueue {
465
472
  );
466
473
  }
467
474
 
468
- if (!callback) {
469
- return;
470
- }
471
-
472
- this._successCallbacks.delete(callID);
473
- this._failureCallbacks.delete(callID);
474
- callback(...args);
475
+ try {
476
+ if (!callback) {
477
+ return;
478
+ }
475
479
 
476
- if (__DEV__) {
477
- Systrace.endEvent();
480
+ this._successCallbacks.delete(callID);
481
+ this._failureCallbacks.delete(callID);
482
+ callback(...args);
483
+ } finally {
484
+ if (__DEV__) {
485
+ Systrace.endEvent();
486
+ }
478
487
  }
479
488
  }
480
489
  }