From 255d1cebf2a3a7270b30510d8da3907c079e0d93 Mon Sep 17 00:00:00 2001 From: Samuel Susla Date: Tue, 12 Mar 2024 15:05:51 -0700 Subject: [PATCH] delete passthroughAnimatedPropExplicitValues from animated component (#43407) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/43407 changelog: [internal] `passthroughAnimatedPropExplicitValues` is not used. Let's remove it. Reviewed By: yungsters Differential Revision: D54583470 fbshipit-source-id: 9e480e4bf3216d4d6c9d7eac99a6b4d5a2e9583f --- .../Animated/createAnimatedComponent.js | 23 +++---------------- .../__snapshots__/public-api-test.js.snap | 8 +------ 2 files changed, 4 insertions(+), 27 deletions(-) diff --git a/packages/react-native/Libraries/Animated/createAnimatedComponent.js b/packages/react-native/Libraries/Animated/createAnimatedComponent.js index 78b66e094812d2..90878ca81bd6db 100644 --- a/packages/react-native/Libraries/Animated/createAnimatedComponent.js +++ b/packages/react-native/Libraries/Animated/createAnimatedComponent.js @@ -8,19 +8,12 @@ * @format */ -import View from '../Components/View/View'; import useMergeRefs from '../Utilities/useMergeRefs'; import useAnimatedProps from './useAnimatedProps'; import * as React from 'react'; // $FlowFixMe[deprecated-type] -export type AnimatedProps = $ObjMap< - Props & - $ReadOnly<{ - passthroughAnimatedPropExplicitValues?: React.ElementConfig, - }>, - () => any, ->; +export type AnimatedProps = $ObjMap any>; export type AnimatedComponentType< Props: {...}, @@ -43,19 +36,9 @@ export default function createAnimatedComponent( // transformed and Pressable, onPress will not work after transform // without these passthrough values. // $FlowFixMe[prop-missing] - const {passthroughAnimatedPropExplicitValues, style} = reducedProps; - const {style: passthroughStyle, ...passthroughProps} = - passthroughAnimatedPropExplicitValues ?? {}; - const mergedStyle = {...style, ...passthroughStyle}; + const {style} = reducedProps; - return ( - - ); + return ; }, ); diff --git a/packages/react-native/Libraries/__tests__/__snapshots__/public-api-test.js.snap b/packages/react-native/Libraries/__tests__/__snapshots__/public-api-test.js.snap index ab7be2f1001e90..290704597d70e4 100644 --- a/packages/react-native/Libraries/__tests__/__snapshots__/public-api-test.js.snap +++ b/packages/react-native/Libraries/__tests__/__snapshots__/public-api-test.js.snap @@ -810,13 +810,7 @@ exports[`public API should not change unintentionally Libraries/Animated/compone `; exports[`public API should not change unintentionally Libraries/Animated/createAnimatedComponent.js 1`] = ` -"export type AnimatedProps = $ObjMap< - Props & - $ReadOnly<{ - passthroughAnimatedPropExplicitValues?: React.ElementConfig, - }>, - () => any, ->; +"export type AnimatedProps = $ObjMap any>; export type AnimatedComponentType< Props: { ... }, +Instance = mixed,