-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
While-loop causes browser crashes #982
Comments
Please try with v9.0.0-rc.2 |
Thanks for the quick answer. |
Can you reliably reproduce this with a git repository? So I can take a look 👍 |
Tried this today with v9 rc3 and also experiencing the same locally using the same example as listed above - react-spring site example:
Chrome Version 81.0.4044.138 (Official Build) (64-bit) Note: The tab does not die if the while loop is removed, so I'm guessing it has something to do with that. Upgrading to latest Chrome didn't seem to change anything. EDIT: Was able to reproduce in v9.0.0 rc2 as well. |
That code is incorrect for v9. See its latest version here: The infinite loop is triggered when the |
Even better than what I linked above: In v9, you can use the const props = useSpring({
to: { radians: radians: 2 * Math.PI },
from: { radians: 0 },
loop: true,
config: { duration: 3500 },
}) |
Thanks for the clarification, this solved it! Appreciate the prompt response @aleclarson, I see I'm not the only one taking advantage of the day off 😄 ! |
The latest v9 docs are here: https://aleclarson.github.io/react-spring/v9/ Breaking changes have their own page: https://aleclarson.github.io/react-spring/v9/breaking-changes/ |
🐛 Bug Report
At the react-spring website https://www.react-spring.io/ one of the examples for useSpring() is this codesandbox https://codesandbox.io/embed/8ypj5vq6m9. This code sandbox works perfectly in the sandbox but in a real project it causes browser tab crashes. I copyed the code and changed it to my use and the browser tab always crashes due to the
while(1)
loop. This issue is similar to #591 which should be fixed since April 2019. I tried with the 9.0.0 beta too but nothing changed. I also tested with different browsers (Chrome, Microsoft Edge Canary, Internet Explorer, Microsoft Edge) but at every browser the site crashed.To Reproduce
This is my code:
Expected behavior
The while loop executes too fast what causes a browser tab crash.
Link to repro (highly encouraged)
https://codesandbox.io/embed/8ypj5vq6m9 (Example from https://www.react-spring.io/docs/hooks/use-spring which even causes crashes on this website)
Environment
react-spring
v9.0.0-beta.34 and v8.0.27react
v16.12.0The text was updated successfully, but these errors were encountered: