Skip to content

Commit

Permalink
fix(useVisibility): log error message when missing refs
Browse files Browse the repository at this point in the history
  • Loading branch information
sabertazimi committed Aug 8, 2021
1 parent e52bf91 commit 353269a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/hooks/useVisibility.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ const useVisibility = ({
const oldBottomPassed = bottomPassed.current;

if (!ref.current) {
throw new Error('Ref to HTML Element missing!');
console.error('Ref to HTML Element missing!');
return;
}

// calculate visibility
Expand Down

0 comments on commit 353269a

Please sign in to comment.