pmndrs / pmndrs/react-spring

[bug]: Browser freeze with prop change in nested animations

Open
#1,831 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area: core kind: bug type: help wanted
Dominant language
TypeScript
Stars
29.1k
Forks
1.2k
PR merge metrics
No merged PRs in 30d

Description

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?

I have an animated loop rotating a container, contained in an animated loop moving the container.

The animation sometimes randomly freezes the browser, which prompts me to stop the webpage.The console indicates the script got stopped in the flushUpdate method.

To Reproduce

See codesandbox. Doesn't freeze every time, but if you click the box a couple of times it should freeze.

I think the root cause is that there is an outer animation, with an inner animation that has a loop. I tried splitting the animated.div component in two separate nested components, one for the translation and one for the rotation, but the result is the same: browser ends up freezing.

Tried on Firefox only.

Expected Behaviour

Browser should never freeze.

Link to repo

https://codesandbox.io/s/interesting-raman-p8y5j?file=/src/index.js

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the freeze from the linked CodeSandbox, starting with src/index.js and the nested loop animations described in the report. Inspect the flushUpdate path indicated by the console and verify behavior in Firefox after clicking the box repeatedly. Done means repeated interaction no longer freezes the browser.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.