Reuse Animated Value
The fewer animations in the timeline, the better the performance. When animating multiple CSS properties with the same duration and start time, you don’t need to create a new animation for each property.
- Ensure that you animate from
0
to1
, as this range represents the progress. - Use
AnimationInfo.value
instead ofAnimationInfo.progress
becauseAnimationInfo.value
accounts for the animationdirection
, whereasAnimationInfo.progress
does not. - Do not pass an easing function; leave it as the default so you can assign one to each css property.
Reuse Values