React router and queryClient.fetchQuery() inside loader make useQuery() to only return 'success'
React router useQuery() is only returning status 'success' when we call queryClient.fetchQuery() inside the loader, when it should be returning 'loading' or 'success', link to codesandbox.io, check src/routes/contact.jsx: https://codesandbox.io/p/sandbox/dark-http-q2zkgk?embed=1&file=%2Fsrc%2Froutes%2Fcontact.jsx%3A24%2C12
dark-http-q2zkgk
CodeSandbox is an online editor tailored for web applications.
1 Reply
extended-salmonOP•3y ago
Link to issue: https://github.com/TanStack/query/issues/5689
GitHub
useQuery() is only returning status 'success' if we call queryClien...
Describe the bug When we use useQuery() in a component is only returning status 'success' if we call queryClient.fetchQuery() inside a React router loader, when it should be returning '...