TanStackT
TanStack11mo ago
1 reply
sad-indigo

useQuery optional arguments?

Hello folks,

I can't find any information about how custom hook with useQuery handles optional arguments when sometimes like example i want to use useUsers() but also implementation like useUsers({params={id:100}, default: false}) would also work. So im wondering if i dont pass any args cache would work fine if default fallback value would be empty object {} or will it be unique cache every time cuz object would reference to new instance everytime hook is called. What would be best solution for this?
Screenshot_2025-02-17-22-03-47-836_com.openai.chatgpt-edit.jpg
Was this page helpful?