给定下面使用 React 转换组的 React 组件,我怎样才能让转换动画在组件加载时呈现?
从“反应”导入反应;从'react-transition-group'导入{TransitionGroup,Transition};
const FeatureItem3 = class extends React.Component {
constructor() {
super();
this.state = {
animate: true,
};
}
render() {
return (
<TransitionGroup>
<Transition
in={this.state.animate}
timeout={0}
>
<div>xxx</div>
</Transition>
<Transition
in={this.state.animate}
timeout={1000}
>
<div>yyyy</div>
</Transition>
<Transition
in={this.state.animate}
timeout={2200}
>
<div>zzzz</div>
</Transition>
</TransitionGroup>
);
}
};