3 ms·
It may feel excessive to rerender an animating component every animation frame, but in practice it’s generally “fast enough” and I find the declarative programm
by baddox 8y ago
It may feel excessive to rerender an animating component every animation frame, but in practice it’s generally “fast enough” and I find the declarative programming model very nice to grasp mentally.
Regarding the handling of timers, easing functions, etc., that does need to be handled somewhere, but it can be “componentized” so that you can reuse animation logic via a friendly component API without worrying about the underlying bookkeeping. You’ll have to learn and get used to that API, but when you find one that works for you it can be great. Two popular such libraries for React are react-spring and Pose:
http://react-spring.surge.sh/spring http://react-spring.surge.sh/spring
https://popmotion.io/pose/learn/popmotion-get-started/ https://popmotion.io/pose/learn/popmotion-get-started/