啥也不说,上代码
动画组件
import React from 'react';
import {
Animated, View, StyleSheet,
findNodeHandle,
UIManager
} from 'react-native';
interface Props {
// 如果标识值不同,组件将执行动画
sign: string
}
export default class TransitionAnimation extends React.Component<Props> {
// 声明一个动画值
fadeAnim = new Animated.Value(500);
ref = undefined;
width = 0;
height = 0;
state = {
showChildren: this.props.children,
animationing: false
}
shouldComponentUpdate(nextProps, nextState