Replies: 1 comment 1 reply
-
Hey @morgs32 This is due to the react drag and drop lib being fully synchronous, whereas the Electric API is async. When you drop the tile it synchronously updates state in the d&d lib which causes an immediate re-render, but the call to persist the change to the database is async. So even though the update is under the 16ms for a frame it's pushed to the next as it's scheduled in a micro task. It's a side effect of mixing async and sync state. There are a few ways to mitigate this, one we use here were track the moves and invalidate a dirty state, or to use a fully synchronous build of SQLite in the main thread. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I see this comment here:
Why would this be? Is it in the edge case where something else causes this page to rerender?? Like props?
Or is it because the 16ms that it should take to update is not fast enough??
Beta Was this translation helpful? Give feedback.
All reactions