Infinite loop but only in Firefox #3531
Unanswered
AlecRobertson
asked this question in
Q&A
Replies: 1 comment
-
|
Why don't you do something like useMyQuery({
variables: { input: myArray },
pause: !myArray.length,
});that being said, the only reason for this would be if |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I am getting an error in my app but it only occurs in Firefox.
Uncaught Error: Too many re-renders. React limits the number of renders to prevent an infinite loop.It appears to be caused by a query I am running which is taking in an array as an input. I generate the array on each render based on state passed into the particular component:
I am using Urql 2.2.3 so quite possible it's been fixed in a later version but I can't quite figure out why it only happens on Firefox? I don't have any issues on either Safari or Chrome.
If I update the code with a hardcoded array
the issue disappears.
What am I doing wrong? The reason I have to structure the code this way is because I don't want the query to run unless the array has a length.
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions