understanding of React hooks lifecyclebasic knowledge of useEffect cleanup
新手友好度1-100 的估计分数,表示该议题对首次贡献者的友好程度。
50
研究方向
Investigate the useInfiniteScroll hook implementation, specifically the setTimeout call that triggers scrollMethod. The issue suggests that when the component unmounts before the timeout fires, the condition becomes permanently true causing infinite loadMore calls. Check the cleanup logic in the useEffect and ensure that the timeout is cleared on unmount. Look at the return statement of the effect to see if clearTimeout is called. The relevant file is likely `src/useInfiniteScroll/index.ts` or similar. Also review any existing comments or related PRs for proposed fixes.
useInfiniteScroll 在第一次请求还未返回时,快速切换到其他组件,会造成无限循环的请求 · alibaba/hooks#2579 | Good First Issue