Skip to content

Commit

Permalink
Fixing useURLState to be SSR proof (#4027)
Browse files Browse the repository at this point in the history
  • Loading branch information
manojVivek authored Nov 1, 2023
1 parent c2e35e0 commit 34a3412
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ui/packages/shared/components/src/hooks/useURLState.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export const useURLState = ({
withURLUpdate = true,
}: Props): [string | string[], (val: string | string[]) => void] => {
const dispatch = useAppDispatch();
const router = parseParams(window?.location.search);
const router = typeof window !== 'undefined' ? parseParams(window?.location.search) : {};
const [highlightAfterFilteringEnabled] = useUserPreference<boolean>(
USER_PREFERENCES.HIGHTLIGHT_AFTER_FILTERING.key
);
Expand Down

0 comments on commit 34a3412

Please sign in to comment.