Describe the bug#
I've created a minimal reproducible example where I try to showcase that having these properties results in a infinite loop:
- Having a custom hook that calls
useQuery that has a queryFn that returns a complex object, in this case a Geometry object from @arcgis/core
- Two nested components that both uses the hook
- The most inner component wrapped in an element styled using Emotion
Removing any of these from the code seems to solve the issue.
Your minimal, reproducible example#
https://codesandbox.io/p/sandbox/9t48qy?file=%2Fsrc%2FApp.js%3A21%2C16
Steps to reproduce#
Go to the linked sandbox and see the console logs
Expected behavior#
No infinite loop
How often does this bug happen?#
Every time
Screenshots or Videos#
No response
Platform#
- OS: macOS
- Browser: Chrome
- Version: 134.0.6998.166
Tanstack Query adapter#
react-query
TanStack Query version#
v5.71.1
TypeScript version#
No response
Additional context#
Not sure if this is a bug in TanStack Query, Emotion, ArcGIS or a mistake in my code, but when used together it results in an infinite loop of fetches and re-renders.
in the sandbox, the query goes into an error state:
I tried importing it from
"@arcgis/core"but it didn’t work for me:please fix the sandbox (and add the query-devtools)