react query not updating the `error` field on errors
I'm new to using react query and i'm using axios to fetch an REST API, the api is throwing a 4xx error but the
error
field of useQuery() is not updating, the same happens to isError
isLoading
stays true, so the application gets stuck on loading state forever. I've tried setting retry
option to false or 0 but still doesn't work3 Replies
could you please share some code?
my bad, should have provided with the description
I managed to fix this using the
onError()
option, but I found this strange... doesn't feel like it should work like this...alright happy to hear that you fixed it yourself