Skip to content

Commit

Permalink
fixes an issue where window would be undefined within a SSR context
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Plat committed Feb 27, 2022
1 parent 62b7121 commit 5c16f70
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/composables/useClickAway.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import useEventListener from "./useEventListener";
export default function useClickAway(target, handler) {
const event = "pointerdown";

if (!window) {
if (typeof window === 'undefined' || !window) {
return;
}

Expand Down

0 comments on commit 5c16f70

Please sign in to comment.