function Posts() {
const lastElement = useRef();
const observe = useRef();
useEffect(() => {
let callback = function (entries, observe) {
console.log("Див видно");
};
observe.current = new IntersectionObserver(callback);
observe.current.observe(lastElement);
}, []);
return (
<div ref={lastElement}></div>
)
}