Replies: 1 comment
-
+1 |
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.
-
Hi,
I am running into much difficulties trying to understand how the useTable hook is running into a recursive loop. I created a very small example in this snippet of code below. In the useMemo for the data item, passing foo or fooArr as the dependency results in the "maximum update depth exceeded" loop.
If I pass in an empty array, it works. So is the variable num. However, if num is changed by clicking on the div, the "IN" message is never printed.
Does a primitive like num require useState? The real use case is to put the length of the array returned by useSWR as the dependency. Putting the resulting data array as the dependency results in the loop.
I made a similar example with just useMemo and that wasn't the problem, though num didn't work as well.
This is react-table v7.7.0.
Thanks
Matt
Beta Was this translation helpful? Give feedback.
All reactions