import React from 'react'; import { Animated, View } from 'react-native'; import type { StyleProp, ViewStyle } from 'react-native'; import { LinearGradient } from 'expo-linear-gradient'; import type { LinearGradientProps } from 'expo-linear-gradient'; interface SwipeGradientProps extends Omit { style: StyleProp; children?: React.ReactNode; colors?: LinearGradientProps['colors']; } 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);