You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
constpollingTasks=newMap();functionExample(){const{ data }=useSuspenseQuery({queryKey: ['repoData'],queryFn: ()=>{returnaxios.get('https://api.github.com/repos/tannerlinsley/react-query').then((res)=>{returnnewPromise((resolve)=>{setTimeout(()=>{resolve(res.data);},1000);});});},});constid=useId();constt=true;if(t){console.log('c',!pollingTasks.has(id),t,!pollingTasks.has(id)||t);if(!pollingTasks.has(id)||t){console.log('create new one');constpromise=newPromise((resolve)=>{setTimeout(()=>{console.log('resolve');resolve();},1000);});pollingTasks.set(id,promise);use(promise);}}constp=pollingTasks.get(id);console.log('run',id);use(p);// <-- should trigger infinite re-renderreturn(<div><h1>{data.name}</h1><p>{data.description}</p><strong>👀{data.subscribers_count}</strong>{' '}<strong>✨{data.stargazers_count}</strong>{' '}<strong>🍴{data.forks_count}</strong></div>);}
Describe the bug
Your minimal, reproducible example
https://stackblitz.com/edit/tanstack-query-lb2sln?file=src%2Findex.jsx
Steps to reproduce
Just run it
Expected behavior
Should show an infinite loopIt should
How often does this bug happen?
Every time
Screenshots or Videos
No response
Platform
Tanstack Query adapter
react-query
TanStack Query version
v5.18.0
TypeScript version
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: