Replies: 2 comments 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.
-
👋 we've been working the last month on a rebuild of the Electric server over at a temporary repo https://github.com/electric-sql/electric-next/ You can read more about why we made the decision at https://next.electric-sql.com/about We're really excited about all the new possibilities the new server brings and we hope you'll check it out soon and give us your feedback. We're now moving the temporary repo back here. As part of that migration we're closing all the old issues, PRs, and discussions. We really appreciate you taking the time to start this discussion! If it's still relevant in the new system, please reopen. |
Beta Was this translation helpful? Give feedback.
-
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