-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
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
Infinite Loop when maximum update depth exceeds #3251
Comments
I think it's not a bug in react/cra etc. facebook/react#11113 have just not released yet. It's only in master branch, but not in last release (16.0.0) :) |
facebook/react#11113 is about deduplication of warnings, but this one is a hard error. If it keeps happening more than once, then it's a bug somewhere. (Likely in our error overlay.) Note that this doesn't reproduce outside of CRA environment. |
This doesn't repro on |
Verified it happens on stable but not on master, and that copy-pasting latest |
Should be fixed in https://github.com/facebookincubator/create-react-app/releases/tag/v1.0.15 |
This happened for me in react-scripts 1.0.0 and 1.1.1 too |
Had the same error when my routing configuration caused an infinite loop of redirects. It wasn't caused by |
You shouldn't do setState in render() function, it causes loop. so it's a bug in your code |
That was on purpose in the example. That was done to trigger the invalid infinite loop, and then another part of the code is supposed to detect this and halt execution. The actual bug was in the detection code; putting the intentional bug in the example was to purposely trigger the detection code. |
Is this a bug report?
Yes
Can you also reproduce the problem with npm 4.x?
Yes.
Which terms did you search for in User Guide?
not present in guide
Environment
node -v
: v6.11.0npm -v
: 4.6.1yarn --version
(if you use Yarn):npm ls react-scripts
(if you haven’t ejected): 1.0.14Then, specify:
Steps to Reproduce
Generate a CRA app using React 16 and use this snippet below:
Expected Behavior
When you have a react component with a nested update error, you get this error:
The error should print once to the console and the execution should stop.
Actual Behavior
But the execution did not stop. It was going in an infinite loop and printing 2 variants of the same error one after another. Initially assumed it to be a react issue(11136), but turns out:
Screenshot for your reference:
The text was updated successfully, but these errors were encountered: