-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Closed
Description
Describe the bug
When using the output of useQueries in the dependency array of a useEffect, the containing component will rerender infinitely. This bug seems to have been introduced in v3.9.0 and exists in all later versions.
Please see the Codesandbox I created below and change the version of react-query from 3.8.3 to any later version.
To Reproduce
Steps to reproduce the behavior:
- Go to https://codesandbox.io/s/wild-dust-p7swc?file=/src/QueryExample.js
- Change the
react-queryversion fromv3.8.3tov3.9.0or greater to see the issue. (Warning, might freeze your browser due to infinite rerenders)
Expected behavior
Expect the results of v3.8.3 and lower, where the useEffect is only called once when needed.
Desktop (please complete the following information):
- OS: MacOS
- Browser: Chrome - Version 96.0.4664.55 (Official Build) (arm64)
- Version: >v3.9.0
narthur, atsikov, chpio, s900mhz, kachun333 and 2 more
Metadata
Metadata
Assignees
Labels
No labels