mediamonks / react-kit

A collection of React hooks, components and utilities we use at Media.Monks
https://mediamonks.github.io/react-kit/
MIT License
11 stars 2 forks source link

Create option to "delay" a `TransitionPresence` #351

Open ReneDrie opened 5 months ago

ReneDrie commented 5 months ago

In the Immersive Web version we have a useEnabledAnimation hook. These will wait for some certain value to be set to true before calling the animation setups. Ideally I think we just want to have this option with the useAnimation hooks in some ways as well. This would make it easier to delay animations while waiting for content to be loaded or something like that.

I'm not sure what would be the nicest way to implement this, perhaps something together with a TransitionPresence which is "active" by default, but you could also set it to inactive or something?

leroykorterink commented 4 months ago

@ReneDrie I think this can be implemented using the useBeforeUnmount hook, I'll try to make an example when I have time.