react-native-reanimated
Version:
More powerful alternative to Animated library for React Native.
25 lines (22 loc) • 721 B
text/typescript
import { addWhitelistedNativeProps } from '../ConfigHelper';
import type {
AnimatedPropsAdapterFunction,
AnimatedPropsAdapterWorklet,
} from './commonTypes';
// @ts-expect-error This overload is required by our API.
export function createAnimatedPropAdapter(
adapter: AnimatedPropsAdapterFunction,
nativeProps?: string[]
): AnimatedPropsAdapterFunction;
export function createAnimatedPropAdapter(
adapter: AnimatedPropsAdapterWorklet,
nativeProps?: string[]
): AnimatedPropsAdapterWorklet {
const nativePropsToAdd: { [key: string]: boolean } = {};
nativeProps?.forEach((prop) => {
nativePropsToAdd[prop] = true;
});
addWhitelistedNativeProps(nativePropsToAdd);
return adapter;
}
;