snapshotValue not accessible on success #1063
Unanswered
JakeGinnivan
asked this question in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I am managing my optimistic updates outside of React query, because I want to explicitly control clearing creation errors etc (I don't want a RQ refresh to clear my pending create). Also, I render pending items differently so I don't want them to appear to my application like they are actual items.
The lifecycle hooks around mutation and success/error/stable have no state which can be shared. My plan was to return the handle to the pending item (similar concept to a setTimeout handle) but snapshotValue is undefined onSuccess.
The assumption that a snapshotValue is not useful on success prevents managing any external state using the lifecycle hooks react query provides?
Thoughts on making snapshotValue available to onSettled/onSuccess?
Beta Was this translation helpful? Give feedback.
All reactions