Skip to content

Commit f11b58d

Browse files
committed
fixes server-rendered getServerSnapshot requirement
1 parent e4b46fd commit f11b58d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

fast-context-generic/src/createFastContext.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,10 @@ export default function createFastContext<Store>(initialState: Store) {
5555
throw new Error("Store not found");
5656
}
5757

58-
const state = useSyncExternalStore(store.subscribe, () =>
59-
selector(store.get())
58+
const state = useSyncExternalStore(
59+
store.subscribe,
60+
() => selector(store.get()),
61+
() => selector(store.get()),
6062
);
6163

6264
return [state, store.set];

0 commit comments

Comments
 (0)