Skip to content

Commit

Permalink
move client check out of hook
Browse files Browse the repository at this point in the history
  • Loading branch information
mayank99 committed Mar 26, 2024
1 parent 60d9e9f commit aff5411
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/itwinui-react/src/core/utils/hooks/useMediaQuery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ export const useMediaQuery = (queryString: string) => {

return useSyncExternalStore(
subscribe,
typeof window !== 'undefined' ? getSnapshot : () => undefined,
isClient ? getSnapshot : () => undefined,
() => undefined,
);
};

const isClient = typeof document !== 'undefined';

0 comments on commit aff5411

Please sign in to comment.