You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
useEffect(()=>{if(loading)return;if(ref.current){// console.log(ref.current);constlist=ref.current.firstChild;if(list.offsetHeight<ref.current.offsetHeight){console.log("loadMore after deleting");loadMore();}}},[data,loading]);
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
实现:滚动自动加载 + 列表项可删除功能
首次加载,删除列表项到如下状态,列表高度小于容器高度:

useInfiniteScroll 没有自动加载更多
https://codesandbox.io/p/sandbox/q8w2qc
更新:
尝试使用下列方式,判断当 列表高度 小于 容器高度时,手动调用
loadMore
, 不知道这种方式有没有其他问题Beta Was this translation helpful? Give feedback.
All reactions