React CSSTransitionGroup动画不起作用

时间:2017-12-20 16:19:02

标签: javascript reactjs animation reactcsstransitiongroup react-animated

我正在尝试以下简单的显示/隐藏动画,该项目确实出现并消失,但没有任何动画:

toggleChangePassword = () => {
  this.setState({ showChangePassword: !this.state.showChangePassword })
}

....

<button onClick={this.toggleChangePassword}>Forgot your password?</button>

<CSSTransitionGroup
  transitionName="example"
  transitionEnterTimeout={500}
  transitionLeaveTimeout={300}>
  {this.state.showChangePassword && changePassword}
</CSSTransitionGroup>

0 个答案:

没有答案