Skip to content

Commit

Permalink
delete passthroughAnimatedPropExplicitValues from animated component (f…
Browse files Browse the repository at this point in the history
…acebook#43407)

Summary:
Pull Request resolved: facebook#43407

changelog: [internal]

`passthroughAnimatedPropExplicitValues` is not used. Let's remove it.

Reviewed By: yungsters

Differential Revision: D54583470

fbshipit-source-id: 9e480e4bf3216d4d6c9d7eac99a6b4d5a2e9583f
  • Loading branch information
sammy-SC authored and facebook-github-bot committed Mar 12, 2024
1 parent 41b6371 commit 255d1ce
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<Props: {...}> = $ObjMap<
Props &
$ReadOnly<{
passthroughAnimatedPropExplicitValues?: React.ElementConfig<typeof View>,
}>,
() => any,
>;
export type AnimatedProps<Props: {...}> = $ObjMap<Props, () => any>;

export type AnimatedComponentType<
Props: {...},
Expand All @@ -43,19 +36,9 @@ export default function createAnimatedComponent<TProps: {...}, TInstance>(
// 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 (
<Component
{...reducedProps}
{...passthroughProps}
style={mergedStyle}
ref={ref}
/>
);
return <Component {...reducedProps} style={style} ref={ref} />;
},
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<Props: { ... }> = $ObjMap<
Props &
$ReadOnly<{
passthroughAnimatedPropExplicitValues?: React.ElementConfig<typeof View>,
}>,
() => any,
>;
"export type AnimatedProps<Props: { ... }> = $ObjMap<Props, () => any>;
export type AnimatedComponentType<
Props: { ... },
+Instance = mixed,
Expand Down

0 comments on commit 255d1ce

Please sign in to comment.