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
AldiBoi
AldiBoiOP11mo ago
Here is my console
No description
AldiBoi
AldiBoiOP11mo ago
And a snippet of the code
No description
AldiBoi
AldiBoiOP11mo ago
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.
Gabriel
Gabriel11mo ago
If you shared how your component looks like maybe we could help more.
AldiBoi
AldiBoiOP11mo ago
The code has changed now, but at the time of posting it was just a div rendering the data as plaintext.
Want results from more Discord servers?
Add your server