Hey this is an amazing library but I do have an issue that I'm currently facing.
I have a simple app like this:
I click on New Docs, type in quickly something & then click on New Docs again before it saves.
There is an indicator beside it that shows Saving & Saved state. When it's on Saving state & I switch to New Docs, it keeps the old doc empty because the state hadn't been saved.
See the new image below:
I did type in something quickly but clicked on New Docs immediately so it kept that part empty. 1st & 2nd item has Empty Docs in it (see image)
Hey this is an amazing library but I do have an issue that I'm currently facing.
I have a simple app like this:
I click on New Docs, type in quickly something & then click on New Docs again before it saves.
There is an indicator beside it that shows Saving & Saved state. When it's on Saving state & I switch to New Docs, it keeps the old doc empty because the state hadn't been saved.
See the new image below:
I did type in something quickly but clicked on New Docs immediately so it kept that part empty. 1st & 2nd item has Empty Docs in it (see image)
How do I fix it?
I have a full repro at https://github.com/deadcoder0904/docs-autosync/tree/react-autosave (see 2 files: DocsList.tsx & Writer.tsx)
Also, I'm wondering if
alertIfUnsavedChanges
is good to implement. https://github.com/lukesmurray/react-query-autosync has a similar option (search foralertIfUnsavedChanges
on the readme) & here's the implementationBut would love to know if this is a problem with my implementation of
react-autosave
or not using React State perfectly or something else?