-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Description
My Specs
Bug reproduced on MacOS 10.14.3, Chrome 72.0.3626.12, Latest Safari
Latest react-spring@8.0.14
Expected Behaviour
Making endless animation when using while loop shouldn't crash the browser tab.
Works perfectly in CodeSandbox.
What happened instead?
Following this example I tried implementing animation that is playing non-stop when while loop is set to true. I discovered that breaking that while loop crashes browser tabs (Safari, Chrome) both in dev environment and with minified build (Terser). Here is repro repository with the same component as in CodeSandbox.
Also, I found that leaving react-spring docs open for an extended amount of time also crashes the tab, but I can't reproduce it reliably.
Possible leads
-
The fact that it works in CodeSandbox makes me think that it is could be related to build tools, but I can't imagine how.
-
I think that there is a possibility that I should somehow cancel an animation with the second cancel argument in async "to", but there are no examples in the docs. If the problem lies in me misunderstanding how async "to" works, maybe we could add this use case to the docs.
-
Also, using set and stop functions with custom loop using setInterval might help, but I couldn't get them to work as of now, I'm going to try and update later.
-
Heavy inline SVG animation crashes Chrome tab sometimes. This is, I think, mostly not applicable in our case because the same crash happens even if you animate divs. However, people could repro the same behaviour with SVG relatively recently.