Am I using Tanstack Query wrong?
I have a tab with users and admins, when you press the users tab it fetches the users and when you press admins it fetches the admin. But when I am pressing the tabs back and forth the server then freezes, but it is really minimal data coming through, it is the server that is the issue or the way I am fetching the data
5 Replies
harsh-harlequinOP•5mo ago
fair-rose•5mo ago
please provide a complete minimal example git repo
harsh-harlequinOP•5mo ago
@Manuel Schiller I figured the issue out, it was a database issue. just a small question the ternary I added for
queryFn
is that okay to do or is it bad practice?fair-rose•5mo ago
depends on where endpoint comes from
I would probably define two different query options
harsh-harlequinOP•5mo ago
thank you for the advice, I will do that 🙂