Skip to content

Commit 15d5e2a

Browse files
committed
chore: improve code documentation for useHash hook
1 parent 6707e8c commit 15d5e2a

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

‎apps/site/hooks/useHash.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ const getSnapshot = () =>
2929
const getServerSnapshot = () => '';
3030

3131
const useHash = () => {
32+
// Works in both client and server environments, provides the initial value for the store during server rendering and hydration avoiding hydration mismatches
3233
const hash = useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
3334

3435
const setHash = (newHash: string) => {

0 commit comments

Comments
 (0)