Should useMutation provide an option to keep the keepPreviousData? #1642
Unanswered
ericchernuka
asked this question in
Ideas
Replies: 2 comments 4 replies
-
If you have a |
Beta Was this translation helpful? Give feedback.
1 reply
-
Hi... @ericchernuka have you found any solution for this problem. I am also facing the same issue |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Thought I'd ask this before investigating a PR. I have a use case where we have preview functionality within our app to show rendered content. We useMutation to get the API to provide us an updated version of the preview, but upon update the data is cleared when executing the mutation again. The workaround currently is to have a ref above that keeps track of the rendered preview and does not clear it between executions to avoid the content flashing when it's being recreated.
Does anyone have a need for keeping the previous mutate data between executions? I realize one aspect that would need to be figured out would be what happens if an error occurs (keep or clear data).
Beta Was this translation helpful? Give feedback.
All reactions