Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add reverse prop #63

Open
astgermain opened this issue Dec 16, 2020 · 0 comments
Open

Add reverse prop #63

astgermain opened this issue Dec 16, 2020 · 0 comments
Labels
good first issue Good for newcomers

Comments

@astgermain
Copy link

astgermain commented Dec 16, 2020

Animations can easily be reversed for cleanup using state to set the value of a reverse prop and is already implemented but it is not stated in documentation even though it works.

Example:

const [shown, setShown] = useState(false)
const yeetMenu = () => {
    setShown(!shown)
}
<Slide
      duration={500}
      triggerOnce={true}
      direction="right"
      reverse={shown}
> 
<nav>Menu</nav>
<button onClick={yeetMenu}>Close</button>
</Slide>

I couldn't figure out any other way of implementing this feature if it already was it was unclear.

@morellodev morellodev added the good first issue Good for newcomers label Dec 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants