-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Description
Thanks for this great resource!
While I was using the useReactQueryAutoSync hook in my project, I noticed the saveStatus conditional returns unsaved when draft is really saved. I also noticed this wasn't working in the demo.
In useReactQueryAutoSync, onMutation in the useMutation hook will set the draft to undefined setDraft(undefined); after it is mutated. This results in the saveStatus value to equal 'unsaved' when it is really saved. Am I using this setStatus states correctly? If so, a suggestion is to add an or statement to saveStatus. ie for the last conditional:
queryResult.data === draft || draft === undefined ? 'saved' : 'unsaved'
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels