You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
One solution would be forcing fetch to throw on HTTP errors.
The text was updated successfully, but these errors were encountered:
jmunozz
changed the title
Fetch does not throw by default, leading to inconstant behaviour from react-query
Fetch does not throw by default, leading to inconsistent behaviour from react-query
May 2, 2023
Fetch does not throw by default, leading to inconsistent behaviour from react-query
Expected behavior
I want to use react-query isError on HTTP errors like 4XX, 5XX...
Actual behavior
Fetch does not throw by default so we have to check response status before going on. React-query recommends to use like below:
Instead we do not check fetch response in hook:
One solution would be forcing fetch to throw on HTTP errors.
The text was updated successfully, but these errors were encountered: