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
Template using isError, not error, to detect an error state
Fire a query that resolves and displays normally
Fire a query that fails and introduces an error state
The isError state is false, but there is clearly an error present.
I think the desired effect is that if an error is encountered in the new/latest query, the status should not be success with the previous data, but error with the new query.
if we don't want to keep anything in case of error (not even the existing previous data), I think it would be as simple as adding a check for status !== 'error' to this check:
keepPreviousData: true
isError
, noterror
, to detect an error stateisError
state isfalse
, but there is clearly anerror
present.I think the desired effect is that if an
error
is encountered in the new/latest query, the status should not besuccess
with the previous data, buterror
with the new query.Codesandbox: https://codesandbox.io/s/optimistic-hooks-n5v12?file=/src/index.js
The text was updated successfully, but these errors were encountered: