Skip to content

Commit c86caaf

Browse files
committed
fix(ssr): provide getServerSnapshot for external-store hooks and stabilize dialog manager lifecycle
1 parent 6d4ccaf commit c86caaf

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/components/ChannelList/hooks/useSelectedChannelState.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,5 +45,5 @@ export function useSelectedChannelState<O>({
4545
return selector(channel);
4646
}, [channel, selector]);
4747

48-
return useSyncExternalStore(subscribe, getSnapshot);
48+
return useSyncExternalStore(subscribe, getSnapshot, getSnapshot);
4949
}

src/store/hooks/useStateStore.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,11 @@ export function useStateStore<
5959
};
6060
}, [store, selector]);
6161

62-
const state = useSyncExternalStore(wrappedSubscription, wrappedSnapshot);
62+
const state = useSyncExternalStore(
63+
wrappedSubscription,
64+
wrappedSnapshot,
65+
wrappedSnapshot,
66+
);
6367

6468
return state;
6569
}

0 commit comments

Comments
 (0)