Skip to content
This repository has been archived by the owner on May 11, 2023. It is now read-only.

Animating mounting/un-mounting #66

Open
lukebennett88 opened this issue Jun 12, 2020 · 1 comment
Open

Animating mounting/un-mounting #66

lukebennett88 opened this issue Jun 12, 2020 · 1 comment
Labels
enhancement New feature or request

Comments

@lukebennett88
Copy link

Hi there, I just found this project and it looks fantastic!

I've had a quick look through the docs, and didn't see anything on the topic, but I was wondering if this library can be used to animate mounting and un-mounting a component?

@lukebennett88 lukebennett88 changed the title Animation Animating mounting/un-mounting Jun 12, 2020
@parkerziegler
Copy link
Contributor

👋 Hey @lukebennett88, thanks for the kind words!

The library can be used to animate initial mount – in fact that's really the default setup for things. When a component using a renature hook mounts, the animation immediately gets run by default. This CodeSandbox should make it a bit clearer – clicking the button will mount the Mover component, and the component animates in gracefully.

Unmounting is something we haven't covered yet, but I'm guessing you're after an API where you could specify a from / to pair for unmounting, where:

  • Component is instructed by React to unmount.
  • We start the frame loop and animate the value from a certain from value to a to value before removing it from the DOM.

I'd definitely like to support this, just need to do some more research on how similar animation libs take care of it. I'll put it on the roadmap and drop updates here as we make progress. Thanks for checking out renature!

@parkerziegler parkerziegler added the enhancement New feature or request label Aug 5, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants