motiondivision / motion

A modern animation library for React and JavaScript
https://motion.dev
MIT License
25.98k stars 852 forks source link

[FEATURE] Manually update animations without `requestAnimationFrame` #2496

Open mattrossman opened 10 months ago

mattrossman commented 10 months ago

Is your feature request related to a problem? Please describe.

Framer Motion's animations stop working in scenarios where window.requestAnimationFrame isn't available.

See https://github.com/pmndrs/react-xr/issues/180 for an example of how this is an issue when using framer-motion or framer-motion-3d in a WebXR immersive session.

Describe the solution you'd like

Expose some way of manually updating animations, so users can pick an appropriate looping mechanism when requestAnimationFrame is unavailable.

Describe alternatives you've considered n/a

Additional context

GSAP provides an .updateRoot() method for this purpose: https://gsap.com/docs/v3/GSAP/gsap.updateRoot()/

jjrchrds commented 9 months ago

@mattrossman were you able to find another solution for this?

mattrossman commented 9 months ago

@jjrchrds No, I ended up using a different animation library (react-spring) due to this limitation.