chenglou / chenglou/react-motion

react revert animation once it's finished

Open
#376 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
21.9k
Forks
1.1k
PR merge metrics
No merged PRs in 30d

Description

How do we do the animation again in the opposite direction once it's immediately finished? It works fine if I do this.setState({slideUp: !this.state.slideUp}); inside a click handler. It's just when setting the state in the animations rest function it doesn't work and I cannot figure out why.

i.e. slide down immediately when slideup has finished.

```
constructor(props)
{
this.state = {
slideUp: true
}
}

_shuffleAnimationCallback = () => {
...
this.setState({slideUp: !this.state.slideUp});
}

this._shuffleAnimationCallback()}>
{(values) =>


    {this.state.playlistComponent}
}}

```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.