import React from "react"; import {Animated, UIManager, ViewStyle} from "react-native"; export interface PullAnimationProps { styleProps?: ViewStyle; yValues: {from?: number; to?: number}; isRefreshing: boolean; minPullDistance: number; scrollY: Animated.Value; } type BaseComponentProps = PullAnimationProps; UIManager.setLayoutAnimationEnabledExperimental && UIManager.setLayoutAnimationEnabledExperimental(true); export const PullAnimation: React.FunctionComponent = ({styleProps, isRefreshing, scrollY, minPullDistance, yValues, children}) => ( {React.Children.map(children, (child) => { return React.cloneElement(child as any, { isRefreshing, scrollY, minPullDistance, }); })} );