Trpc useQuery keeps refetching even with no errors (I am getting back data every time)
Hey everyone, I tried looking into why this might happen, and either dont know enough about it to describe it or have a peculiar issue.
In my client side component, I have a useQuery from trpc/react/. Whenever I call my procedure with parameters, (two Dates in my case), my procure spam calls, although it returns data each time. I am at a loss, and have been looking for docs for this. Any pointers to what might be going on would be appreciated. (Images otw)
5 Replies
Here is my console
And a snippet of the code
I have the issue fixed for now by refactoring to use the server side funciton (Which was a huge performance bumb btw!) but if anyone has any idea why this behaved this way, I would love to know. I may have to use the function in a client component, and have no Idea how i messed it up this badly.
If you shared how your component looks like maybe we could help more.
The code has changed now, but at the time of posting it was just a div rendering the data as plaintext.