From 3821767c505afa763a306ef8c25451da95a1d2d3 Mon Sep 17 00:00:00 2001 From: Petyo Ivanov Date: Fri, 29 Mar 2024 16:06:19 +0200 Subject: [PATCH] fix: SSR --- src/hooks.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/hooks.ts b/src/hooks.ts index 79157fb..725d0f5 100644 --- a/src/hooks.ts +++ b/src/hooks.ts @@ -47,7 +47,11 @@ export function useCellValue(cell: NodeRef) { [realm, cell] ) - return React.useSyncExternalStore(cb, () => realm.getValue(cell)) + return React.useSyncExternalStore( + cb, + () => realm.getValue(cell), + () => realm.getValue(cell) + ) } /** @@ -99,7 +103,11 @@ export function useCellValues(...cells: Array>): unknown[] { // eslint-disable-next-line react-hooks/exhaustive-deps [realm, ...cells] ) - return React.useSyncExternalStore(cb, () => currentRef.current) + return React.useSyncExternalStore( + cb, + () => currentRef.current, + () => currentRef.current + ) } /**