From dfcbc3d0d5d47cfca7232c38e5cfa10c0184e7c6 Mon Sep 17 00:00:00 2001 From: clockwork-labs-bot Date: Fri, 6 Mar 2026 15:28:00 -0500 Subject: [PATCH] Fix useTable isReady reverting to false after first row event (#4559) The subscribe callback passed to useSyncExternalStore captured computeSnapshot in its closure but did not list it as a dependency. When subscribeApplied flipped to true, computeSnapshot was recreated with the new value, but subscribe still held the stale closure that permanently captured subscribeApplied = false. Adding computeSnapshot to subscribe's dependency array ensures the event handlers always call the current computeSnapshot, so isReady stays true after onApplied fires. --- crates/bindings-typescript/src/react/useTable.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/crates/bindings-typescript/src/react/useTable.ts b/crates/bindings-typescript/src/react/useTable.ts index 5d3c1edd86c..bcb21004a63 100644 --- a/crates/bindings-typescript/src/react/useTable.ts +++ b/crates/bindings-typescript/src/react/useTable.ts @@ -210,6 +210,7 @@ export function useTable( connectionState, accessorName, querySql, + computeSnapshot, callbacks?.onDelete, callbacks?.onInsert, callbacks?.onUpdate,