How to stop error from wiping data when using placeholderData
.
#5753
Unanswered
audunolsen
asked this question in
Q&A
Replies: 1 comment 7 replies
-
previousData refers to data of the previous query key. This is, per design, only displayed as long as the current query is in-flight. Example:
essentially, there is nothing to show for |
Beta Was this translation helpful? Give feedback.
7 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'd like for my UI to persist (keeping relevant data) and showing the error on top. It's pretty confusing and somewhat panic inducing for an end user to see their entire view be replaced w/ an error instead of just showing an error alongside an already established view.
I know InitialData kind of does this, but it reverts data to that initial value when erroring, it doesn't keep its most recent data when erroring. I need to use placeHolderData as this is what (apparently) facilitates keeping previous data in v5.
Am I missing something or is this just not possible w/ current state of API? Easy workarounds?
Beta Was this translation helpful? Give feedback.
All reactions