framer / motion

Open source, production-ready animation and gesture library for React
https://framer.com/motion
MIT License
23.39k stars 784 forks source link

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

Open mattrossman opened 7 months ago

mattrossman commented 7 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 6 months ago

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

mattrossman commented 6 months ago

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