Skip to content

[bug]: Several rAF calls per one frame #1829

@quebits

Description

@quebits

Which react-spring target are you using?

  • @react-spring/web
  • @react-spring/three
  • @react-spring/native
  • @react-spring/konva
  • @react-spring/zdog

What version of react-spring are you using?

9.4.2

What's Wrong?

When using animation with conditional switching between immediate states it's looks like some kind of race condition happens. It cause inertia animation to accidentally stops on a half way (especially in Safari 15.3&15.4, Chrome is less affected). Debugging shows that two rAF handlers executes in one animation frame.

To Reproduce

Use provided sandox. Its not mine but reproducible.
Select "@react-spring/web" version newer then 9.4-alpha.0.
And try to drag & release.
Animation will stops almost immediately.

Expected Behaviour

Smooth & continuous animation.

Link to repo

https://codesandbox.io/s/react-spring-920-beta-touch-scrolling-example-5riij?file=/src/App.tsx

Metadata

Metadata

Assignees

Labels

kind: bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions