Skip to content

Commit

Permalink
Fix ssr issues [prerelease]
Browse files Browse the repository at this point in the history
  • Loading branch information
MosheZemah committed Oct 9, 2024
1 parent d32bab3 commit 8b4767e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/core/src/hooks/useClickOutside/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ export default function useClickOutside({
[ref, callback, ignoreClasses]
);

const documentRef = useRef(typeof document !== "undefined" ? document.body : null);
const hasDocument = typeof document !== "undefined";
const documentRef = useRef(hasDocument ? document.body : null);

useEventListener({
eventName,
Expand Down

0 comments on commit 8b4767e

Please sign in to comment.