import React from 'react'; import { Animated, StyleProp, View, ViewStyle } from 'react-native'; import { LinearGradient, LinearGradientProps } from 'expo-linear-gradient'; interface SwipeGradientProps extends Omit { style: StyleProp; children?: React.ReactNode; colors?: string[]; } class SwipeGradientView extends React.Component { render() { const { style, children, colors, start, end, locations } = this.props; if (colors) { if (!children) { return ( ); } return ( {children} ); } return {children}; } } export default SwipeGradientView; export const AnimatedGradient = Animated.createAnimatedComponent(SwipeGradientView);