@office-iss/react-native-win32 0.79.1 → 0.80.0

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 (294) hide show
  1. package/.flowconfig +10 -3
  2. package/CHANGELOG.json +117 -24
  3. package/CHANGELOG.md +49 -14
  4. package/IntegrationTests/ImageCachePolicyTest.js +1 -1
  5. package/IntegrationTests/LayoutEventsTest.js +1 -4
  6. package/Libraries/Alert/Alert.d.ts +4 -1
  7. package/Libraries/Alert/Alert.js +3 -0
  8. package/Libraries/Alert/RCTAlertManager.js +17 -0
  9. package/Libraries/Animated/Animated.js.flow +1 -3
  10. package/Libraries/Animated/AnimatedEvent.js +4 -3
  11. package/Libraries/Animated/AnimatedExports.js +2 -2
  12. package/Libraries/Animated/AnimatedExports.js.flow +140 -0
  13. package/Libraries/Animated/AnimatedImplementation.js +2 -123
  14. package/Libraries/Animated/Easing.js +13 -15
  15. package/Libraries/Animated/animations/Animation.js +8 -4
  16. package/Libraries/Animated/components/AnimatedFlatList.js +7 -6
  17. package/Libraries/Animated/components/AnimatedScrollView.js +48 -42
  18. package/Libraries/Animated/components/AnimatedSectionList.js +11 -7
  19. package/Libraries/Animated/createAnimatedComponent.js +105 -57
  20. package/Libraries/Animated/nodes/AnimatedNode.js +4 -3
  21. package/Libraries/Animated/nodes/AnimatedProps.js +46 -26
  22. package/Libraries/Animated/nodes/AnimatedValue.js +16 -7
  23. package/Libraries/Animated/nodes/AnimatedValueXY.js +3 -1
  24. package/Libraries/AppState/AppState.js +7 -2
  25. package/Libraries/BatchedBridge/MessageQueue.js +2 -2
  26. package/Libraries/BatchedBridge/NativeModules.js +2 -0
  27. package/Libraries/Blob/BlobManager.js +1 -0
  28. package/Libraries/Blob/FileReader.js +219 -8
  29. package/Libraries/Blob/URL.js +37 -12
  30. package/Libraries/Blob/URLSearchParams.js +106 -31
  31. package/Libraries/Blob/URLSearchParams.js.flow +12 -7
  32. package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.js +1 -1
  33. package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.win32.js +1 -1
  34. package/Libraries/Components/AccessibilityInfo/legacySendAccessibilityEvent.js +17 -0
  35. package/Libraries/Components/ActivityIndicator/ActivityIndicator.js +1 -0
  36. package/Libraries/Components/Button.js +1 -1
  37. package/Libraries/Components/Button.win32.js +1 -1
  38. package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.android.js +1 -3
  39. package/Libraries/{NewAppScreen/components/Colors.js → Components/DrawerAndroid/DrawerLayoutAndroid.ios.js} +6 -10
  40. package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.js +6 -66
  41. package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.js.flow +18 -0
  42. package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroidFallback.js +71 -0
  43. package/Libraries/Components/Keyboard/Keyboard.js +5 -3
  44. package/Libraries/Components/Keyboard/KeyboardAvoidingView.js +6 -3
  45. package/Libraries/Components/Pressable/Pressable.js +20 -4
  46. package/Libraries/Components/Pressable/Pressable.win32.js +20 -4
  47. package/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.js +25 -3
  48. package/Libraries/Components/ProgressBarAndroid/ProgressBarAndroidTypes.js +29 -20
  49. package/Libraries/Components/RefreshControl/RefreshControl.js +1 -1
  50. package/Libraries/Components/ScrollView/ScrollView.d.ts +3 -3
  51. package/Libraries/Components/ScrollView/ScrollView.js +132 -122
  52. package/Libraries/Components/StaticRenderer.js +1 -1
  53. package/Libraries/Components/Switch/Switch.d.ts +3 -0
  54. package/Libraries/Components/Switch/Switch.js +8 -4
  55. package/Libraries/Components/TextInput/AndroidTextInputNativeComponent.js +2 -1
  56. package/Libraries/Components/TextInput/RCTTextInputViewConfig.js +2 -4
  57. package/Libraries/Components/TextInput/Tests/TextInputTest.d.ts +2 -1
  58. package/Libraries/Components/TextInput/Tests/TextInputTest.js.map +1 -1
  59. package/Libraries/Components/TextInput/TextInput.d.ts +70 -33
  60. package/Libraries/Components/TextInput/TextInput.flow.js +100 -51
  61. package/Libraries/Components/TextInput/TextInput.flow.win32.js +1208 -0
  62. package/Libraries/Components/TextInput/TextInput.js +88 -1027
  63. package/Libraries/Components/TextInput/TextInput.win32.js +89 -1059
  64. package/Libraries/Components/TextInput/TextInputState.js +1 -1
  65. package/Libraries/Components/TextInput/TextInputState.win32.js +1 -1
  66. package/Libraries/{Modal/ModalInjection.js → Components/ToastAndroid/ToastAndroid.ios.js} +3 -5
  67. package/Libraries/Components/ToastAndroid/ToastAndroid.js +4 -32
  68. package/Libraries/Components/ToastAndroid/ToastAndroid.js.flow +109 -0
  69. package/Libraries/Components/ToastAndroid/ToastAndroid.win32.js +4 -32
  70. package/Libraries/Components/ToastAndroid/ToastAndroidFallback.js +45 -0
  71. package/Libraries/Components/Touchable/Tests/TouchableWin32Test.d.ts +2 -1
  72. package/Libraries/Components/Touchable/Tests/TouchableWin32Test.js.map +1 -1
  73. package/Libraries/Components/Touchable/Touchable.js +5 -5
  74. package/Libraries/Components/Touchable/Touchable.win32.js +5 -5
  75. package/Libraries/Components/Touchable/TouchableBounce.js +14 -7
  76. package/Libraries/Components/Touchable/TouchableHighlight.js +10 -7
  77. package/Libraries/Components/Touchable/TouchableNativeFeedback.js +6 -6
  78. package/Libraries/Components/Touchable/TouchableNativeFeedback.win32.js +6 -6
  79. package/Libraries/Components/Touchable/TouchableOpacity.js +13 -6
  80. package/Libraries/Components/View/View.js +18 -21
  81. package/Libraries/Components/View/View.win32.js +21 -24
  82. package/Libraries/Components/View/ViewAccessibility.js +25 -1
  83. package/Libraries/Components/View/ViewAccessibility.win32.js +9 -1
  84. package/Libraries/Components/View/ViewPropTypes.js +49 -3
  85. package/Libraries/Components/View/ViewPropTypes.win32.js +49 -3
  86. package/Libraries/Core/ReactNativeVersion.js +1 -1
  87. package/Libraries/Core/setUpReactDevTools.js +5 -5
  88. package/Libraries/Debugging/DebuggingOverlayRegistry.js +3 -3
  89. package/Libraries/EventEmitter/NativeEventEmitter.js +9 -4
  90. package/Libraries/Image/AssetSourceResolver.js +17 -4
  91. package/Libraries/Image/Image.d.ts +26 -10
  92. package/Libraries/Image/Image.js +17 -0
  93. package/Libraries/Image/Image.js.flow +5 -5
  94. package/Libraries/Image/ImageBackground.js +2 -0
  95. package/Libraries/Image/ImageInjection.js +1 -1
  96. package/Libraries/Image/ImageProps.js +22 -17
  97. package/Libraries/Image/ImageSource.js +3 -1
  98. package/Libraries/Image/ImageSourceUtils.js +4 -2
  99. package/Libraries/Image/ImageTypes.flow.js +1 -1
  100. package/Libraries/Image/Tests/ImageWin32Test.d.ts +2 -1
  101. package/Libraries/Image/Tests/ImageWin32Test.js.map +1 -1
  102. package/Libraries/Interaction/InteractionManager.d.ts +13 -0
  103. package/Libraries/Interaction/InteractionManager.js +1 -1
  104. package/Libraries/Interaction/PanResponder.js +3 -3
  105. package/Libraries/Interaction/TaskQueue.js +1 -0
  106. package/Libraries/LayoutAnimation/LayoutAnimation.js +2 -2
  107. package/Libraries/Linking/Linking.js +1 -1
  108. package/Libraries/Lists/FlatList.d.ts +2 -2
  109. package/Libraries/Lists/FlatList.js +8 -11
  110. package/Libraries/Lists/SectionList.js +39 -42
  111. package/Libraries/Lists/SectionListModern.js +25 -34
  112. package/Libraries/Lists/VirtualizedList.js +1 -0
  113. package/Libraries/Lists/VirtualizedSectionList.js +1 -0
  114. package/Libraries/LogBox/Data/LogBoxData.js +1 -1
  115. package/Libraries/LogBox/LogBoxNotificationContainer.js +1 -1
  116. package/Libraries/LogBox/UI/LogBoxInspectorSourceMapStatus.win32.js +140 -0
  117. package/Libraries/Modal/Modal.js +33 -7
  118. package/Libraries/NativeComponent/BaseViewConfig.android.js +2 -0
  119. package/Libraries/NativeComponent/BaseViewConfig.ios.js +2 -0
  120. package/Libraries/NativeComponent/BaseViewConfig.js +17 -0
  121. package/Libraries/NativeComponent/BaseViewConfig.win32.js +1 -0
  122. package/Libraries/NativeComponent/PlatformBaseViewConfig.js +2 -2
  123. package/Libraries/NativeModules/specs/NativeDevMenu.js +2 -2
  124. package/Libraries/Network/RCTNetworking.android.js +1 -1
  125. package/Libraries/Network/RCTNetworking.ios.js +1 -1
  126. package/Libraries/Network/RCTNetworking.js +17 -0
  127. package/Libraries/Network/RCTNetworking.js.flow +1 -1
  128. package/Libraries/Network/RCTNetworking.win32.js +1 -1
  129. package/Libraries/Network/XMLHttpRequest.js +781 -10
  130. package/Libraries/Performance/Systrace.js +7 -7
  131. package/Libraries/Pressability/Pressability.js +1 -1
  132. package/Libraries/Pressability/Pressability.win32.js +1 -1
  133. package/Libraries/ReactNative/AppContainer-dev.js +5 -4
  134. package/Libraries/ReactNative/AppRegistry.flow.js +49 -0
  135. package/Libraries/ReactNative/AppRegistry.js +2 -322
  136. package/Libraries/ReactNative/AppRegistry.js.flow +23 -0
  137. package/Libraries/ReactNative/AppRegistryImpl.js +316 -0
  138. package/Libraries/ReactNative/FabricUIManager.js +10 -0
  139. package/Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricHostComponent.js +2 -4
  140. package/Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricPublicInstance.js +1 -4
  141. package/Libraries/ReactNative/RendererImplementation.js +10 -5
  142. package/Libraries/ReactNative/getNativeComponentAttributes.js +1 -0
  143. package/Libraries/ReactNative/renderApplication.js +9 -0
  144. package/Libraries/ReactPrivate/ReactNativePrivateInterface.js +3 -3
  145. package/Libraries/ReactPrivate/ReactNativePrivateInterface.js.flow +51 -0
  146. package/Libraries/Renderer/implementations/ReactFabric-dev.js +4840 -4748
  147. package/Libraries/Renderer/implementations/ReactFabric-prod.js +4947 -4829
  148. package/Libraries/Renderer/implementations/ReactFabric-profiling.js +3998 -3888
  149. package/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js +5005 -4948
  150. package/Libraries/Renderer/implementations/ReactNativeRenderer-prod.js +2744 -2652
  151. package/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.js +5020 -4933
  152. package/Libraries/Renderer/shims/ReactNativeTypes.js +3 -3
  153. package/Libraries/Settings/Settings.ios.js +1 -0
  154. package/Libraries/Settings/Settings.js +13 -19
  155. package/Libraries/Settings/Settings.win32.js +19 -20
  156. package/Libraries/Settings/SettingsFallback.js +33 -0
  157. package/Libraries/StyleSheet/PlatformColorValueTypes.js +15 -0
  158. package/Libraries/StyleSheet/PlatformColorValueTypesIOS.js +6 -0
  159. package/Libraries/StyleSheet/Rect.js +1 -0
  160. package/Libraries/StyleSheet/StyleSheet.js +31 -200
  161. package/Libraries/StyleSheet/StyleSheet.js.flow +188 -0
  162. package/Libraries/StyleSheet/{StyleSheet.win32.js → StyleSheetExports.js} +2 -151
  163. package/Libraries/StyleSheet/StyleSheetExports.js.flow +112 -0
  164. package/Libraries/StyleSheet/StyleSheetTypes.d.ts +1 -1
  165. package/Libraries/StyleSheet/StyleSheetTypes.js +130 -52
  166. package/Libraries/StyleSheet/flattenStyle.js +14 -4
  167. package/Libraries/StyleSheet/private/_TransformStyle.js +49 -21
  168. package/Libraries/StyleSheet/processBackgroundImage.js +670 -214
  169. package/Libraries/Text/Text.d.ts +2 -5
  170. package/Libraries/Text/Text.js +3 -3
  171. package/Libraries/Text/Text.win32.js +3 -3
  172. package/Libraries/Text/TextNativeComponent.js +0 -4
  173. package/Libraries/Text/TextNativeComponent.win32.js +0 -4
  174. package/Libraries/Text/TextProps.js +5 -33
  175. package/Libraries/Text/TextProps.win32.js +5 -30
  176. package/Libraries/Types/CodegenTypesNamespace.d.ts +45 -0
  177. package/Libraries/{Blob/__mocks__/BlobModule.js → Types/CodegenTypesNamespace.js} +4 -6
  178. package/Libraries/Types/CoreEventTypes.d.ts +6 -1
  179. package/Libraries/Types/CoreEventTypes.js +1 -1
  180. package/Libraries/Types/CoreEventTypes.win32.js +1 -1
  181. package/Libraries/Utilities/Appearance.js +2 -0
  182. package/Libraries/Utilities/BackHandler.js +17 -0
  183. package/Libraries/Utilities/DeviceInfo.js +2 -0
  184. package/Libraries/Utilities/Dimensions.js +1 -1
  185. package/Libraries/Utilities/Dimensions.win32.js +1 -1
  186. package/Libraries/Utilities/Platform.js +17 -0
  187. package/Libraries/Utilities/PlatformTypes.js +11 -3
  188. package/Libraries/Utilities/ReactNativeTestTools.js +2 -2
  189. package/Libraries/Utilities/codegenNativeCommands.d.ts +18 -0
  190. package/Libraries/Utilities/codegenNativeComponent.d.ts +26 -0
  191. package/Libraries/WebSocket/WebSocket.js +313 -8
  192. package/Libraries/vendor/core/ErrorUtils.js +28 -2
  193. package/Libraries/vendor/emitter/EventEmitter.js +6 -2
  194. package/flow/global.js +1 -0
  195. package/index.js +51 -331
  196. package/index.win32.js +71 -352
  197. package/interface.js +0 -4
  198. package/jest/resolver.js +31 -0
  199. package/overrides.json +45 -47
  200. package/package.json +25 -25
  201. package/src/private/animated/NativeAnimatedHelper.js +21 -8
  202. package/src/private/animated/NativeAnimatedHelper.win32.js +21 -8
  203. package/src/private/animated/createAnimatedPropsHook.js +11 -16
  204. package/src/private/animated/createAnimatedPropsMemoHook.js +1 -2
  205. package/src/private/components/{SafeAreaView_INTERNAL_DO_NOT_USE.js → safeareaview/SafeAreaView_INTERNAL_DO_NOT_USE.js} +6 -6
  206. package/src/private/components/{HScrollViewNativeComponents.js → scrollview/HScrollViewNativeComponents.js} +8 -8
  207. package/src/private/components/scrollview/VScrollViewNativeComponents.js +25 -0
  208. package/src/private/{devmenu → devsupport/devmenu}/DevMenu.js +1 -1
  209. package/src/private/{inspector → devsupport/devmenu/elementinspector}/BorderBox.js +3 -3
  210. package/src/private/{inspector → devsupport/devmenu/elementinspector}/BoxInspector.js +6 -5
  211. package/src/private/{inspector → devsupport/devmenu/elementinspector}/ElementBox.js +8 -6
  212. package/src/private/{inspector → devsupport/devmenu/elementinspector}/ElementProperties.js +11 -10
  213. package/src/private/{inspector → devsupport/devmenu/elementinspector}/Inspector.js +14 -12
  214. package/src/private/{inspector → devsupport/devmenu/elementinspector}/InspectorOverlay.js +5 -4
  215. package/src/private/{inspector → devsupport/devmenu/elementinspector}/InspectorPanel.js +9 -8
  216. package/src/private/{inspector → devsupport/devmenu/elementinspector}/NetworkOverlay.js +10 -9
  217. package/src/private/{inspector → devsupport/devmenu/elementinspector}/ReactDevToolsOverlay.js +7 -7
  218. package/src/private/{inspector → devsupport/devmenu/elementinspector}/StyleInspector.js +7 -6
  219. package/src/private/{inspector → devsupport/devmenu/elementinspector}/XHRInterceptor.js +2 -2
  220. package/src/private/{inspector → devsupport/devmenu/elementinspector}/getInspectorDataForViewAtPoint.js +4 -4
  221. package/src/private/{inspector → devsupport/devmenu/elementinspector}/resolveBoxStyle.js +1 -1
  222. package/src/private/{inspector → devsupport/devmenu/perfmonitor}/PerformanceOverlay.js +6 -5
  223. package/src/private/{specs_DEPRECATED/modules → devsupport/devmenu/specs}/NativeDevMenu.js +2 -2
  224. package/src/private/{debugging → devsupport/rndevtools}/ReactDevToolsSettingsManager.android.js +1 -1
  225. package/src/private/{debugging → devsupport/rndevtools}/ReactDevToolsSettingsManager.ios.js +1 -1
  226. package/src/private/{debugging → devsupport/rndevtools}/ReactDevToolsSettingsManager.win32.js +1 -1
  227. package/src/private/{debugging → devsupport/rndevtools}/setUpFuseboxReactDevToolsDispatcher.js +1 -1
  228. package/src/private/{fusebox → devsupport/rndevtools}/specs/NativeReactDevToolsRuntimeSettingsModule.js +2 -2
  229. package/src/private/{specs_DEPRECATED/modules → devsupport/rndevtools/specs}/NativeReactDevToolsSettingsManager.js +2 -2
  230. package/src/private/featureflags/ReactNativeFeatureFlags.js +82 -80
  231. package/src/private/featureflags/ReactNativeFeatureFlagsBase.js +9 -1
  232. package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +17 -13
  233. package/src/private/renderer/errorhandling/ErrorHandlers.js +2 -2
  234. package/src/private/specs_DEPRECATED/modules/NativeAnimatedModule.js +1 -1
  235. package/src/private/specs_DEPRECATED/modules/NativeAnimatedTurboModule.js +1 -1
  236. package/src/private/specs_DEPRECATED/modules/NativeSampleTurboModule.js +3 -0
  237. package/src/private/styles/composeStyles.js +12 -5
  238. package/src/private/types/HostComponent.js +1 -1
  239. package/src/private/types/HostInstance.js +67 -1
  240. package/src/private/webapis/dom/nodes/ReactNativeElement.js +2 -5
  241. package/src/private/webapis/dom/nodes/ReadOnlyNode.js +5 -18
  242. package/src/private/webapis/dom/nodes/internals/NodeInternals.js +6 -0
  243. package/src/private/webapis/performance/Performance.js +1 -3
  244. package/src/private/webapis/performance/PerformanceEntry.js +6 -1
  245. package/src/private/webapis/performance/internals/RawPerformanceEntry.js +3 -0
  246. package/src/private/webapis/performance/specs/NativePerformance.js +10 -1
  247. package/src/types/globals.d.ts +42 -0
  248. package/src-win/Libraries/Components/TextInput/Tests/TextInputTest.tsx +7 -7
  249. package/src-win/Libraries/Components/Touchable/Tests/TouchableWin32Test.tsx +3 -3
  250. package/src-win/Libraries/Image/Tests/ImageWin32Test.tsx +1 -1
  251. package/src-win/Libraries/Text/Text.d.ts +2 -5
  252. package/types/index.d.ts +6 -3
  253. package/types/public/ReactNativeTypes.d.ts +2 -2
  254. package/Libraries/BatchedBridge/__mocks__/MessageQueueTestConfig.js +0 -38
  255. package/Libraries/BatchedBridge/__mocks__/MessageQueueTestModule.js +0 -22
  256. package/Libraries/Blob/FileReader_new.js +0 -231
  257. package/Libraries/Blob/FileReader_old.js +0 -186
  258. package/Libraries/Blob/__mocks__/FileReaderModule.js +0 -20
  259. package/Libraries/Components/RefreshControl/__mocks__/RefreshControlMock.js +0 -32
  260. package/Libraries/Core/__mocks__/ErrorUtils.js +0 -33
  261. package/Libraries/Core/__mocks__/NativeExceptionsManager.js +0 -19
  262. package/Libraries/EventEmitter/__mocks__/NativeEventEmitter.js +0 -49
  263. package/Libraries/Events/CustomEvent.js +0 -32
  264. package/Libraries/Events/EventPolyfill.js +0 -239
  265. package/Libraries/Lists/__flowtests__/FlatList-flowtest.js +0 -118
  266. package/Libraries/Lists/__flowtests__/SectionList-flowtest.js +0 -134
  267. package/Libraries/Network/XMLHttpRequest_new.js +0 -794
  268. package/Libraries/Network/XMLHttpRequest_old.js +0 -701
  269. package/Libraries/NewAppScreen/components/DebugInstructions.js +0 -41
  270. package/Libraries/NewAppScreen/components/Header.js +0 -77
  271. package/Libraries/NewAppScreen/components/HermesBadge.js +0 -53
  272. package/Libraries/NewAppScreen/components/LearnMoreLinks.js +0 -148
  273. package/Libraries/NewAppScreen/components/ReloadInstructions.js +0 -39
  274. package/Libraries/NewAppScreen/components/logo.png +0 -0
  275. package/Libraries/NewAppScreen/index.js +0 -25
  276. package/Libraries/StyleSheet/__flowtests__/StyleSheet-flowtest.js +0 -58
  277. package/Libraries/Utilities/DeviceInfo.win32.js +0 -19
  278. package/Libraries/Utilities/__mocks__/BackHandler.js +0 -45
  279. package/Libraries/Utilities/__mocks__/GlobalPerformanceLogger.js +0 -16
  280. package/Libraries/Utilities/__mocks__/PixelRatio.js +0 -25
  281. package/Libraries/WebSocket/WebSocketEvent.js +0 -30
  282. package/Libraries/WebSocket/WebSocket_new.js +0 -325
  283. package/Libraries/WebSocket/WebSocket_old.js +0 -297
  284. package/Libraries/WebSocket/__mocks__/event-target-shim.js +0 -27
  285. package/Libraries/__flowtests__/ReactNativeTypes-flowtest.js +0 -30
  286. package/Libraries/vendor/emitter/__flowtests__/EventEmitter-flowtest.js +0 -81
  287. package/flow/jest.js +0 -1287
  288. package/jest/__tests__/setup-test.js +0 -18
  289. package/src/private/components/VScrollViewNativeComponents.js +0 -25
  290. package/src/private/utilities/ensureInstance.js +0 -21
  291. package/src/private/webapis/performance/specs/__mocks__/NativePerformanceMock.js +0 -267
  292. package/types/modules/LaunchScreen.d.ts +0 -18
  293. /package/src/private/{devmenu → devsupport/devmenu}/DevMenu.d.ts +0 -0
  294. /package/src/private/{debugging → devsupport/rndevtools}/FuseboxSessionObserver.js +0 -0
@@ -540,9 +540,9 @@ function unforkEvent(
540
540
  }
541
541
  }
542
542
 
543
- const event = function (
543
+ const event = function <T>(
544
544
  argMapping: $ReadOnlyArray<?Mapping>,
545
- config: EventConfig,
545
+ config: EventConfig<T>,
546
546
  ): any {
547
547
  const animatedEvent = new AnimatedEvent(argMapping, config);
548
548
  if (animatedEvent.__isNative) {
@@ -606,144 +606,23 @@ export default {
606
606
  * See https://reactnative.dev/docs/animated#node
607
607
  */
608
608
  Node: AnimatedNode,
609
-
610
- /**
611
- * Animates a value from an initial velocity to zero based on a decay
612
- * coefficient.
613
- *
614
- * See https://reactnative.dev/docs/animated#decay
615
- */
616
609
  decay,
617
- /**
618
- * Animates a value along a timed easing curve. The Easing module has tons of
619
- * predefined curves, or you can use your own function.
620
- *
621
- * See https://reactnative.dev/docs/animated#timing
622
- */
623
610
  timing,
624
- /**
625
- * Animates a value according to an analytical spring model based on
626
- * damped harmonic oscillation.
627
- *
628
- * See https://reactnative.dev/docs/animated#spring
629
- */
630
611
  spring,
631
-
632
- /**
633
- * Creates a new Animated value composed from two Animated values added
634
- * together.
635
- *
636
- * See https://reactnative.dev/docs/animated#add
637
- */
638
612
  add,
639
-
640
- /**
641
- * Creates a new Animated value composed by subtracting the second Animated
642
- * value from the first Animated value.
643
- *
644
- * See https://reactnative.dev/docs/animated#subtract
645
- */
646
613
  subtract,
647
-
648
- /**
649
- * Creates a new Animated value composed by dividing the first Animated value
650
- * by the second Animated value.
651
- *
652
- * See https://reactnative.dev/docs/animated#divide
653
- */
654
614
  divide,
655
-
656
- /**
657
- * Creates a new Animated value composed from two Animated values multiplied
658
- * together.
659
- *
660
- * See https://reactnative.dev/docs/animated#multiply
661
- */
662
615
  multiply,
663
-
664
- /**
665
- * Creates a new Animated value that is the (non-negative) modulo of the
666
- * provided Animated value.
667
- *
668
- * See https://reactnative.dev/docs/animated#modulo
669
- */
670
616
  modulo,
671
-
672
- /**
673
- * Create a new Animated value that is limited between 2 values. It uses the
674
- * difference between the last value so even if the value is far from the
675
- * bounds it will start changing when the value starts getting closer again.
676
- *
677
- * See https://reactnative.dev/docs/animated#diffclamp
678
- */
679
617
  diffClamp,
680
-
681
- /**
682
- * Starts an animation after the given delay.
683
- *
684
- * See https://reactnative.dev/docs/animated#delay
685
- */
686
618
  delay,
687
- /**
688
- * Starts an array of animations in order, waiting for each to complete
689
- * before starting the next. If the current running animation is stopped, no
690
- * following animations will be started.
691
- *
692
- * See https://reactnative.dev/docs/animated#sequence
693
- */
694
619
  sequence,
695
- /**
696
- * Starts an array of animations all at the same time. By default, if one
697
- * of the animations is stopped, they will all be stopped. You can override
698
- * this with the `stopTogether` flag.
699
- *
700
- * See https://reactnative.dev/docs/animated#parallel
701
- */
702
620
  parallel,
703
- /**
704
- * Array of animations may run in parallel (overlap), but are started in
705
- * sequence with successive delays. Nice for doing trailing effects.
706
- *
707
- * See https://reactnative.dev/docs/animated#stagger
708
- */
709
621
  stagger,
710
- /**
711
- * Loops a given animation continuously, so that each time it reaches the
712
- * end, it resets and begins again from the start.
713
- *
714
- * See https://reactnative.dev/docs/animated#loop
715
- */
716
622
  loop,
717
-
718
- /**
719
- * Takes an array of mappings and extracts values from each arg accordingly,
720
- * then calls `setValue` on the mapped outputs.
721
- *
722
- * See https://reactnative.dev/docs/animated#event
723
- */
724
623
  event,
725
-
726
- /**
727
- * Make any React component Animatable. Used to create `Animated.View`, etc.
728
- *
729
- * See https://reactnative.dev/docs/animated#createanimatedcomponent
730
- */
731
624
  createAnimatedComponent,
732
-
733
- /**
734
- * Imperative API to attach an animated value to an event on a view. Prefer
735
- * using `Animated.event` with `useNativeDrive: true` if possible.
736
- *
737
- * See https://reactnative.dev/docs/animated#attachnativeevent
738
- */
739
625
  attachNativeEvent,
740
-
741
- /**
742
- * Advanced imperative API for snooping on animated events that are passed in
743
- * through props. Use values directly where possible.
744
- *
745
- * See https://reactnative.dev/docs/animated#forkevent
746
- */
747
626
  forkEvent,
748
627
  unforkEvent,
749
628
 
@@ -12,6 +12,8 @@
12
12
 
13
13
  let ease;
14
14
 
15
+ export type EasingFunction = (t: number) => number;
16
+
15
17
  /**
16
18
  * The `Easing` module implements common easing functions. This module is used
17
19
  * by [Animate.timing()](docs/animate.html#timing) to convey physically
@@ -57,7 +59,7 @@ let ease;
57
59
  * - [`inOut`](docs/easing.html#inout) makes any easing function symmetrical
58
60
  * - [`out`](docs/easing.html#out) runs an easing function backwards
59
61
  */
60
- const Easing = {
62
+ const EasingStatic = {
61
63
  /**
62
64
  * A stepping function, returns 1 for any positive value of `n`.
63
65
  */
@@ -90,7 +92,7 @@ const Easing = {
90
92
  */
91
93
  ease(t: number): number {
92
94
  if (!ease) {
93
- ease = Easing.bezier(0.42, 0, 1, 1);
95
+ ease = EasingStatic.bezier(0.42, 0, 1, 1);
94
96
  }
95
97
  return ease(t);
96
98
  },
@@ -121,7 +123,7 @@ const Easing = {
121
123
  * n = 4: http://easings.net/#easeInQuart
122
124
  * n = 5: http://easings.net/#easeInQuint
123
125
  */
124
- poly(n: number): (t: number) => number {
126
+ poly(n: number): EasingFunction {
125
127
  return (t: number) => Math.pow(t, n);
126
128
  },
127
129
 
@@ -162,7 +164,7 @@ const Easing = {
162
164
  *
163
165
  * http://easings.net/#easeInElastic
164
166
  */
165
- elastic(bounciness: number = 1): (t: number) => number {
167
+ elastic(bounciness: number = 1): EasingFunction {
166
168
  const p = bounciness * Math.PI;
167
169
  return t => 1 - Math.pow(Math.cos((t * Math.PI) / 2), 3) * Math.cos(t * p);
168
170
  },
@@ -173,7 +175,7 @@ const Easing = {
173
175
  *
174
176
  * https://easings.net/#easeInBack
175
177
  */
176
- back(s: number = 1.70158): (t: number) => number {
178
+ back(s: number = 1.70158): EasingFunction {
177
179
  return t => t * t * ((s + 1) * t - s);
178
180
  },
179
181
 
@@ -208,12 +210,7 @@ const Easing = {
208
210
  * A useful tool to visualize cubic bezier curves can be found at
209
211
  * http://cubic-bezier.com/
210
212
  */
211
- bezier(
212
- x1: number,
213
- y1: number,
214
- x2: number,
215
- y2: number,
216
- ): (t: number) => number {
213
+ bezier(x1: number, y1: number, x2: number, y2: number): EasingFunction {
217
214
  const _bezier = require('./bezier').default;
218
215
  return _bezier(x1, y1, x2, y2);
219
216
  },
@@ -221,14 +218,14 @@ const Easing = {
221
218
  /**
222
219
  * Runs an easing function forwards.
223
220
  */
224
- in(easing: (t: number) => number): (t: number) => number {
221
+ in(easing: EasingFunction): EasingFunction {
225
222
  return easing;
226
223
  },
227
224
 
228
225
  /**
229
226
  * Runs an easing function backwards.
230
227
  */
231
- out(easing: (t: number) => number): (t: number) => number {
228
+ out(easing: EasingFunction): EasingFunction {
232
229
  return t => 1 - easing(1 - t);
233
230
  },
234
231
 
@@ -237,7 +234,7 @@ const Easing = {
237
234
  * forwards for half of the duration, then backwards for the rest of the
238
235
  * duration.
239
236
  */
240
- inOut(easing: (t: number) => number): (t: number) => number {
237
+ inOut(easing: EasingFunction): EasingFunction {
241
238
  return t => {
242
239
  if (t < 0.5) {
243
240
  return easing(t * 2) / 2;
@@ -247,4 +244,5 @@ const Easing = {
247
244
  },
248
245
  };
249
246
 
250
- export default Easing;
247
+ export type Easing = typeof EasingStatic;
248
+ export default EasingStatic;
@@ -13,10 +13,14 @@ import type AnimatedNode from '../nodes/AnimatedNode';
13
13
  import type AnimatedValue from '../nodes/AnimatedValue';
14
14
 
15
15
  import NativeAnimatedHelper from '../../../src/private/animated/NativeAnimatedHelper';
16
- import * as ReactNativeFeatureFlags from '../../../src/private/featureflags/ReactNativeFeatureFlags';
17
16
  import AnimatedProps from '../nodes/AnimatedProps';
18
17
 
19
- export type EndResult = {finished: boolean, value?: number, ...};
18
+ export type EndResult = {
19
+ finished: boolean,
20
+ value?: number,
21
+ offset?: number,
22
+ ...
23
+ };
20
24
  export type EndCallback = (result: EndResult) => void;
21
25
 
22
26
  export type AnimationConfig = $ReadOnly<{
@@ -141,9 +145,9 @@ export default class Animation {
141
145
  // When using natively driven animations, once the animation completes,
142
146
  // we need to ensure that the JS side nodes are synced with the updated
143
147
  // values.
144
- const {value} = result;
148
+ const {value, offset} = result;
145
149
  if (value != null) {
146
- animatedValue.__onAnimatedValueUpdateReceived(value);
150
+ animatedValue.__onAnimatedValueUpdateReceived(value, offset);
147
151
 
148
152
  if (this.__isLooping === true) {
149
153
  return;
@@ -8,13 +8,14 @@
8
8
  * @format
9
9
  */
10
10
 
11
- import type {AnimatedComponentType} from '../createAnimatedComponent';
11
+ import type {AnimatedProps} from '../createAnimatedComponent';
12
12
 
13
- import FlatList from '../../Lists/FlatList';
13
+ import FlatList, {type FlatListProps} from '../../Lists/FlatList';
14
14
  import createAnimatedComponent from '../createAnimatedComponent';
15
15
  import * as React from 'react';
16
16
 
17
- export default (createAnimatedComponent(FlatList): AnimatedComponentType<
18
- React.ElementConfig<typeof FlatList>,
19
- FlatList<mixed>,
20
- >);
17
+ // $FlowExpectedError[unclear-type]
18
+ export default (createAnimatedComponent(FlatList): component<ItemT = any>(
19
+ ref?: React.RefSetter<FlatList<ItemT>>,
20
+ ...props: AnimatedProps<FlatListProps<ItemT>>
21
+ ));
@@ -23,48 +23,51 @@ import useAnimatedProps from '../useAnimatedProps';
23
23
  import * as React from 'react';
24
24
  import {useMemo} from 'react';
25
25
 
26
- type Props = React.ElementConfig<typeof ScrollView>;
27
- type Instance = React.ElementRef<typeof ScrollView>;
26
+ type AnimatedScrollViewProps = React.ElementConfig<typeof ScrollView>;
27
+ type AnimatedScrollViewInstance = React.ElementRef<typeof ScrollView>;
28
28
 
29
29
  /**
30
30
  * @see https://github.com/facebook/react-native/commit/b8c8562
31
31
  */
32
- const AnimatedScrollView: AnimatedComponentType<Props, Instance> =
33
- React.forwardRef(
34
- function AnimatedScrollViewWithOrWithoutInvertedRefreshControl(
35
- props,
36
- forwardedRef,
32
+ const AnimatedScrollView: AnimatedComponentType<
33
+ AnimatedScrollViewProps,
34
+ AnimatedScrollViewInstance,
35
+ > = React.forwardRef(
36
+ function AnimatedScrollViewWithOrWithoutInvertedRefreshControl(
37
+ props,
38
+ forwardedRef,
39
+ ) {
40
+ // (Android only) When a ScrollView has a RefreshControl and
41
+ // any `style` property set with an Animated.Value, the CSS
42
+ // gets incorrectly applied twice. This is because ScrollView
43
+ // swaps the parent/child relationship of itself and the
44
+ // RefreshControl component (see ScrollView.js for more details).
45
+ if (
46
+ Platform.OS === 'android' &&
47
+ props.refreshControl != null &&
48
+ props.style != null
37
49
  ) {
38
- // (Android only) When a ScrollView has a RefreshControl and
39
- // any `style` property set with an Animated.Value, the CSS
40
- // gets incorrectly applied twice. This is because ScrollView
41
- // swaps the parent/child relationship of itself and the
42
- // RefreshControl component (see ScrollView.js for more details).
43
- if (
44
- Platform.OS === 'android' &&
45
- props.refreshControl != null &&
46
- props.style != null
47
- ) {
48
- return (
49
- // $FlowFixMe[prop-missing]
50
- <AnimatedScrollViewWithInvertedRefreshControl
51
- scrollEventThrottle={0.0001}
52
- {...props}
53
- ref={forwardedRef}
54
- refreshControl={props.refreshControl}
55
- />
56
- );
57
- } else {
58
- return (
59
- <AnimatedScrollViewWithoutInvertedRefreshControl
60
- scrollEventThrottle={0.0001}
61
- {...props}
62
- ref={forwardedRef}
63
- />
64
- );
65
- }
66
- },
67
- );
50
+ return (
51
+ // $FlowFixMe - It should return an Animated ScrollView but it returns a ScrollView with Animated props applied.
52
+ <AnimatedScrollViewWithInvertedRefreshControl
53
+ scrollEventThrottle={0.0001}
54
+ {...props}
55
+ ref={forwardedRef}
56
+ // $FlowFixMe[incompatible-type]
57
+ refreshControl={props.refreshControl}
58
+ />
59
+ );
60
+ } else {
61
+ return (
62
+ <AnimatedScrollViewWithoutInvertedRefreshControl
63
+ scrollEventThrottle={0.0001}
64
+ {...props}
65
+ ref={forwardedRef}
66
+ />
67
+ );
68
+ }
69
+ },
70
+ );
68
71
 
69
72
  const AnimatedScrollViewWithInvertedRefreshControl = React.forwardRef(
70
73
  // $FlowFixMe[incompatible-call]
@@ -75,8 +78,8 @@ const AnimatedScrollViewWithInvertedRefreshControl = React.forwardRef(
75
78
  refreshControl: ExactReactElement_DEPRECATED<any>,
76
79
  },
77
80
  forwardedRef:
78
- | {current: Instance | null, ...}
79
- | ((Instance | null) => mixed),
81
+ | {current: AnimatedScrollViewInstance | null, ...}
82
+ | ((AnimatedScrollViewInstance | null) => mixed),
80
83
  ) {
81
84
  // Split `props` into the animate-able props for the parent (RefreshControl)
82
85
  // and child (ScrollView).
@@ -106,10 +109,13 @@ const AnimatedScrollViewWithInvertedRefreshControl = React.forwardRef(
106
109
 
107
110
  // Handle animated props on `NativeDirectionalScrollView`.
108
111
  const [scrollViewAnimatedProps, scrollViewRef] = useAnimatedProps<
109
- Props,
110
- Instance,
112
+ AnimatedScrollViewProps,
113
+ AnimatedScrollViewInstance,
111
114
  >(intermediatePropsForScrollView);
112
- const ref = useMergeRefs<Instance>(scrollViewRef, forwardedRef);
115
+ const ref = useMergeRefs<AnimatedScrollViewInstance>(
116
+ scrollViewRef,
117
+ forwardedRef,
118
+ );
113
119
 
114
120
  return (
115
121
  // $FlowFixMe[incompatible-use] Investigate useAnimatedProps return value
@@ -8,15 +8,19 @@
8
8
  * @format
9
9
  */
10
10
 
11
- import type {SectionBase} from '../../Lists/SectionList';
12
- import type {AnimatedComponentType} from '../createAnimatedComponent';
11
+ import type {AnimatedProps} from '../createAnimatedComponent';
13
12
 
14
- import SectionList from '../../Lists/SectionList';
13
+ import SectionList, {type SectionListProps} from '../../Lists/SectionList';
15
14
  import createAnimatedComponent from '../createAnimatedComponent';
16
15
  import * as React from 'react';
17
16
 
18
- export default (createAnimatedComponent(SectionList): AnimatedComponentType<
19
- React.ElementConfig<typeof SectionList>,
17
+ // $FlowFixMe
18
+ export default (createAnimatedComponent(SectionList): component<
20
19
  // $FlowExpectedError[unclear-type]
21
- SectionList<SectionBase<any>>,
22
- >);
20
+ ItemT = any,
21
+ // $FlowExpectedError[unclear-type]
22
+ SectionT = any,
23
+ >(
24
+ ref?: React.RefSetter<SectionList<ItemT, SectionT>>,
25
+ ...props: AnimatedProps<SectionListProps<ItemT, SectionT>>
26
+ ));
@@ -8,7 +8,16 @@
8
8
  * @format
9
9
  */
10
10
 
11
+ import type AnimatedAddition from './nodes/AnimatedAddition';
12
+ import type AnimatedDiffClamp from './nodes/AnimatedDiffClamp';
13
+ import type AnimatedDivision from './nodes/AnimatedDivision';
14
+ import type AnimatedInterpolation from './nodes/AnimatedInterpolation';
15
+ import type AnimatedModulo from './nodes/AnimatedModulo';
16
+ import type AnimatedMultiplication from './nodes/AnimatedMultiplication';
17
+ import type AnimatedNode from './nodes/AnimatedNode';
11
18
  import type {AnimatedPropsAllowlist} from './nodes/AnimatedProps';
19
+ import type AnimatedSubtraction from './nodes/AnimatedSubtraction';
20
+ import type AnimatedValue from './nodes/AnimatedValue';
12
21
 
13
22
  import createAnimatedPropsHook from '../../src/private/animated/createAnimatedPropsHook';
14
23
  import composeStyles from '../../src/private/styles/composeStyles';
@@ -17,81 +26,120 @@ import useMergeRefs from '../Utilities/useMergeRefs';
17
26
  import * as React from 'react';
18
27
  import {useMemo} from 'react';
19
28
 
20
- export type AnimatedProps<Props: {...}> = {
21
- // eslint-disable-next-line no-unused-vars
22
- +[_K in keyof (Props &
23
- $ReadOnly<{
24
- passthroughAnimatedPropExplicitValues?: React.ElementConfig<
25
- typeof View,
26
- >,
27
- }>)]: any,
28
- };
29
+ type Nullable = void | null;
30
+ type Primitive = string | number | boolean | symbol | void;
31
+ type Builtin = (...$ReadOnlyArray<empty>) => mixed | Date | Error | RegExp;
32
+
33
+ export type WithAnimatedValue<+T> = T extends Builtin | Nullable
34
+ ? T
35
+ : T extends Primitive
36
+ ?
37
+ | T
38
+ | AnimatedNode
39
+ | AnimatedAddition
40
+ | AnimatedSubtraction
41
+ | AnimatedDivision
42
+ | AnimatedMultiplication
43
+ | AnimatedModulo
44
+ | AnimatedDiffClamp
45
+ | AnimatedValue
46
+ | AnimatedInterpolation<number | string>
47
+ | AnimatedInterpolation<number>
48
+ | AnimatedInterpolation<string>
49
+ : T extends $ReadOnlyArray<infer P>
50
+ ? $ReadOnlyArray<WithAnimatedValue<P>>
51
+ : T extends {...}
52
+ ? {+[K in keyof T]: WithAnimatedValue<T[K]>}
53
+ : T;
29
54
 
30
- // We could use a mapped type here to introduce acceptable Animated variants
31
- // of properties, instead of doing so in the core StyleSheetTypes
32
- // Inexact Props are not supported, they'll be made exact here.
33
- export type StrictAnimatedProps<Props: {...}> = $ReadOnly<{
34
- ...$Exact<Props>,
35
- passthroughAnimatedPropExplicitValues?: ?Props,
55
+ type NonAnimatedProps =
56
+ | 'ref'
57
+ | 'innerViewRef'
58
+ | 'scrollViewRef'
59
+ | 'testID'
60
+ | 'disabled'
61
+ | 'accessibilityLabel';
62
+ type PassThroughProps = $ReadOnly<{
63
+ passthroughAnimatedPropExplicitValues?: React.ElementConfig<
64
+ typeof View,
65
+ > | null,
36
66
  }>;
37
67
 
68
+ export type AnimatedProps<Props: {...}> = {
69
+ [K in keyof Props]: K extends NonAnimatedProps
70
+ ? Props[K]
71
+ : WithAnimatedValue<Props[K]>,
72
+ } & PassThroughProps;
73
+
74
+ export type AnimatedBaseProps<Props: {...}> = {
75
+ [K in keyof Props]: K extends NonAnimatedProps
76
+ ? Props[K]
77
+ : WithAnimatedValue<Props[K]>,
78
+ };
79
+
38
80
  export type AnimatedComponentType<Props: {...}, +Instance = mixed> = component(
39
- ref: React.RefSetter<Instance>,
81
+ ref?: React.RefSetter<Instance>,
40
82
  ...AnimatedProps<Props>
41
83
  );
42
84
 
43
- export type StrictAnimatedComponentType<
44
- Props: {...},
45
- +Instance = mixed,
46
- > = component(ref: React.RefSetter<Instance>, ...StrictAnimatedProps<Props>);
47
-
48
- export default function createAnimatedComponent<TProps: {...}, TInstance>(
49
- Component: component(ref: React.RefSetter<TInstance>, ...TProps),
50
- ): AnimatedComponentType<TProps, TInstance> {
85
+ export default function createAnimatedComponent<
86
+ TInstance: React.ComponentType<any>,
87
+ >(
88
+ Component: TInstance,
89
+ ): AnimatedComponentType<
90
+ $ReadOnly<React.ElementProps<TInstance>>,
91
+ React.ElementRef<TInstance>,
92
+ > {
51
93
  return unstable_createAnimatedComponentWithAllowlist(Component, null);
52
94
  }
53
95
 
54
96
  export function unstable_createAnimatedComponentWithAllowlist<
55
97
  TProps: {...},
56
- TInstance,
98
+ TInstance: React.ComponentType<TProps>,
57
99
  >(
58
- Component: component(ref: React.RefSetter<TInstance>, ...TProps),
100
+ Component: TInstance,
59
101
  allowlist: ?AnimatedPropsAllowlist,
60
- ): StrictAnimatedComponentType<TProps, TInstance> {
102
+ ): AnimatedComponentType<TProps, React.ElementRef<TInstance>> {
61
103
  const useAnimatedProps = createAnimatedPropsHook(allowlist);
62
104
 
63
- const AnimatedComponent = React.forwardRef<
64
- StrictAnimatedProps<TProps>,
65
- TInstance,
66
- >((props, forwardedRef) => {
67
- const [reducedProps, callbackRef] = useAnimatedProps<TProps, TInstance>(
68
- props,
69
- );
70
- const ref = useMergeRefs<TInstance>(callbackRef, forwardedRef);
105
+ const AnimatedComponent: AnimatedComponentType<
106
+ TProps,
107
+ React.ElementRef<TInstance>,
108
+ > = React.forwardRef<AnimatedProps<TProps>, React.ElementRef<TInstance>>(
109
+ (props, forwardedRef) => {
110
+ const [reducedProps, callbackRef] = useAnimatedProps<
111
+ TProps,
112
+ React.ElementRef<TInstance>,
113
+ >(props);
114
+ const ref = useMergeRefs<React.ElementRef<TInstance>>(
115
+ callbackRef,
116
+ forwardedRef,
117
+ );
71
118
 
72
- // Some components require explicit passthrough values for animation
73
- // to work properly. For example, if an animated component is
74
- // transformed and Pressable, onPress will not work after transform
75
- // without these passthrough values.
76
- // $FlowFixMe[prop-missing]
77
- const {passthroughAnimatedPropExplicitValues, style} = reducedProps;
78
- const passthroughStyle = passthroughAnimatedPropExplicitValues?.style;
79
- const mergedStyle = useMemo(
80
- () => composeStyles(style, passthroughStyle),
81
- [passthroughStyle, style],
82
- );
119
+ // Some components require explicit passthrough values for animation
120
+ // to work properly. For example, if an animated component is
121
+ // transformed and Pressable, onPress will not work after transform
122
+ // without these passthrough values.
123
+ // $FlowFixMe[prop-missing]
124
+ const {passthroughAnimatedPropExplicitValues, style} = reducedProps;
125
+ const passthroughStyle = passthroughAnimatedPropExplicitValues?.style;
126
+ const mergedStyle = useMemo(
127
+ () => composeStyles(style, passthroughStyle),
128
+ [passthroughStyle, style],
129
+ );
83
130
 
84
- // NOTE: It is important that `passthroughAnimatedPropExplicitValues` is
85
- // spread after `reducedProps` but before `style`.
86
- return (
87
- <Component
88
- {...reducedProps}
89
- {...passthroughAnimatedPropExplicitValues}
90
- style={mergedStyle}
91
- ref={ref}
92
- />
93
- );
94
- });
131
+ // NOTE: It is important that `passthroughAnimatedPropExplicitValues` is
132
+ // spread after `reducedProps` but before `style`.
133
+ return (
134
+ <Component
135
+ {...reducedProps}
136
+ {...passthroughAnimatedPropExplicitValues}
137
+ style={mergedStyle}
138
+ ref={ref}
139
+ />
140
+ );
141
+ },
142
+ );
95
143
 
96
144
  AnimatedComponent.displayName = `Animated(${
97
145
  Component.displayName || 'Anonymous'
@@ -28,7 +28,7 @@ let _assertNativeAnimatedModule: ?() => void = () => {
28
28
  };
29
29
 
30
30
  export default class AnimatedNode {
31
- #listeners: Map<string, ValueListenerCallback> = new Map();
31
+ #listeners: Map<string, ValueListenerCallback>;
32
32
 
33
33
  _platformConfig: ?PlatformConfig = undefined;
34
34
 
@@ -38,6 +38,7 @@ export default class AnimatedNode {
38
38
  ...
39
39
  }>,
40
40
  ) {
41
+ this.#listeners = new Map();
41
42
  if (__DEV__) {
42
43
  this.__debugID = config?.debugID;
43
44
  }
@@ -111,8 +112,8 @@ export default class AnimatedNode {
111
112
  return this.#listeners.size > 0;
112
113
  }
113
114
 
114
- __onAnimatedValueUpdateReceived(value: number): void {
115
- this.__callListeners(value);
115
+ __onAnimatedValueUpdateReceived(value: number, offset: number): void {
116
+ this.__callListeners(value + offset);
116
117
  }
117
118
 
118
119
  __callListeners(value: number): void {