Function freya::hooks::use_animation_transition
pub fn use_animation_transition<D>(
cx: &ScopeState,
transition: TransitionAnimation,
dependencies: D,
init: impl Fn(<D as UseFutureDep>::Out) -> Vec<Transition, Global>
) -> TransitionsManager<'_>where
D: UseFutureDep,
Expand description
Run a group of animated transitions.
Usage
fn app(cx: Scope) -> Element {
let animation = use_animation_transition(cx, TransitionAnimation::new_linear(50), (), |_| vec![
Transition::new_size(0.0, 100.0)
]);
let progress = animation.get(0).unwrap().as_size();
use_effect(cx, (), move |_| {
animation.start();
async move {}
});
render!(
rect {
width: "{progress}",
}
)
}