我试图让这个组件在安装时移入但得到
Cannot read property 'enter' of undefined
这是一个简化的代码(我已经准备好了所有的 CSS 类):
class Example extends React.Component {
state = {
transitionIn: false,
};
componentDidMount = () => {
this.setState({ transitionIn: true })
}
render() {
return (
<CSSTransition
in={this.state.transitionIn}
timeout={1000}
className={'wordTransition'}
>
<div>dksjfnsdkjnfj</div>
</CSSTransition>
);
}
}