X
Хорошее уточнение
Size: a a a
X
V
V
V
DN
useEffect(() => {
const observer = new IntersectionObserver(
([entry]) => {
if (entry.isIntersecting) {
dispatch(fetchData(paginationOptions.usersPerPage, paginationOptions.currentPage));
dispatch(setCurrentPage());
console.log('It works!',paginationOptions.currentPage )
}
},
{
root: null,
rootMargin: "0px",
threshold: 0.1
}
);
if (ref.current) {
observer.observe(ref.current);
}
return () => { observer.unobserve(ref.current) }
}, [ref]);
С
С
X
useEffect(() => {
const observer = new IntersectionObserver(
([entry]) => {
if (entry.isIntersecting) {
dispatch(fetchData(paginationOptions.usersPerPage, paginationOptions.currentPage));
dispatch(setCurrentPage());
console.log('It works!',paginationOptions.currentPage )
}
},
{
root: null,
rootMargin: "0px",
threshold: 0.1
}
);
if (ref.current) {
observer.observe(ref.current);
}
return () => { observer.unobserve(ref.current) }
}, [ref]);
[ref, paginationOptions
]PM
IN
SG
ДШ
M🐀
ZM
tasks.map((task) => <TaskItem id={task.id} key={task.id}/>)
TaskItemтолько
idпроп, а уже непосредственно в самом
TaskItemбрать целый объект по пропсу
idтипа
const TaskItem = ({ id }) => {?
const task = cache.readData(id);
return <blablabalba.... />
}
IN
SG
M🐀
V
PM
A