refactor
This commit is contained in:
@@ -38,12 +38,12 @@ const useLazyVisibility = (
|
||||
return undefined;
|
||||
}
|
||||
|
||||
if (typeof window === 'undefined' || !('IntersectionObserver' in window)) {
|
||||
if (!window.IntersectionObserver) {
|
||||
setIsVisible(true);
|
||||
return undefined;
|
||||
}
|
||||
|
||||
const observer = new IntersectionObserver(
|
||||
const observer = new window.IntersectionObserver(
|
||||
(entries) => {
|
||||
entries.forEach((entry) => {
|
||||
if (entry.isIntersecting) {
|
||||
|
||||
Reference in New Issue
Block a user