UNPKG

mh-rn-component

Version:

31 lines 957 B
import React, { useState } from 'react' import {StyleProp,ViewStyle} from "react-native" import * as Animatable from 'react-native-animatable'; type Props = { content?: string color?: string, type: string, duration?: number | string, delay?: number | string,//todo 待调整 direction?: "normal" | "reverse" | "alternate" | "alternate-reverse"// 动画重复运行的方向 iterationCount?: number | "infinite" //动画运行次数 iterationDelay?: number, easing?: string children?: any, style?: StyleProp<ViewStyle>, } const AnimateBase = (props: Props) => { return ( <Animatable.View animation={props.type} duration={Number(props.duration)} delay={Number(props.delay)} direction={props.direction} iterationCount={props.iterationCount || 1} iterationDelay={props.iterationDelay || 0} easing={props.easing}> {props.children} </Animatable.View> ) } export default AnimateBase