Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Allow users to set requestAnimationFrame function for svelte/motion #16712

@michealparks

Description

@michealparks

Describe the problem

Within a browser environment, it's not always guaranteed that window.requestAnimationFrame will be driving the rendering animation loop. For example, when a user enters into an immersive XR session, window.requestAnimationFrame will not run, and instead another requestAnimationFrame function on the XRSession object takes over.

In the @threlte/xr package we're currently doing this hack to get around the problem, but depending on an internals export for the package to work correctly with svelte/motion doesn't seem sustainable.

Describe the proposed solution

There are lot of use cases for using svelte/motion in an XR environment - and the package itself uses it internally (example) - so I'd love to see a way for it to be supported in a less fragile way.

Importance

would make my life easier

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions