This commit is contained in:
2024-10-06 08:57:55 +05:30
parent 080ce9ee57
commit 990e7ee75b
48 changed files with 1929 additions and 185 deletions

View File

@ -1,5 +1,6 @@
'use client';
import { useState, useEffect, useRef, RefObject } from 'react';
import { RefObject, useEffect, useRef, useState } from 'react';
import { useSharedIntersectionObserver } from './shared-intersection-observer';
// eslint-disable-next-line no-undef
@ -42,7 +43,7 @@ const useInView = (
return () => {
observerManager.unobserve(element);
};
}, [observerManager]);
}, [observerManager, options]);
return [elementRef, isInView];
};

View File

@ -1,4 +1,4 @@
import { useState, useEffect, RefObject } from 'react';
import { RefObject, useEffect, useState } from 'react';
interface UseInViewOptions {
threshold?: number | number[];