Skip to content

Commit

Permalink
Replace final $ObjMap in react-native with mapped type (#46335)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #46335

Changelog: [Internal]

Reviewed By: panagosg7

Differential Revision: D62208265

fbshipit-source-id: f7c72f7239b49fbaee626c3572c116e26b698300
  • Loading branch information
SamChou19815 authored and facebook-github-bot committed Sep 5, 2024
1 parent 464a202 commit 62ee5c9
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ const AnimatedScrollView: AnimatedComponentType<Props, Instance> =
props.style != null
) {
return (
// $FlowFixMe[prop-missing]
<AnimatedScrollViewWithInvertedRefreshControl
scrollEventThrottle={0.0001}
{...props}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,15 @@ import useAnimatedProps from './useAnimatedProps';
import * as React from 'react';
import {useMemo} from 'react';

// $FlowFixMe[deprecated-type]
export type AnimatedProps<Props: {...}> = $ObjMap<
Props &
$ReadOnly<{
passthroughAnimatedPropExplicitValues?: React.ElementConfig<typeof View>,
}>,
() => any,
>;
export type AnimatedProps<Props: {...}> = {
// eslint-disable-next-line no-unused-vars
+[_K in keyof (Props &
$ReadOnly<{
passthroughAnimatedPropExplicitValues?: React.ElementConfig<
typeof View,
>,
}>)]: any,
};

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

0 comments on commit 62ee5c9

Please sign in to comment.