naver / egjs-infinitegrid

A module used to arrange card elements including content infinitely on a grid layout.
https://naver.github.io/egjs-infinitegrid/
MIT License
2.23k stars 95 forks source link

Maximum update depth exceeded. #579

Open longhonour opened 1 week ago

longhonour commented 1 week ago

Bug: When I browse the example address https://kg9xy4.csb.app/ and scroll to the bottom, while loading data, if I scroll back up with the mouse wheel and repeat this process multiple times quickly, an error occurs. The detailed error information is shown in the image below. I suspect that the setState updating data causes the onRequestAppend to trigger, which in turn triggers setState again, leading to an infinite loop. image

` Error Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops. ▶ 33 stack frames were collapsed. eval /src/App.tsx:39:8 36 | 37 | setTimeout(() => { 38 | e.ready();

39 | setItems([ | ^ 40 | ...items, 41 | ...getItems(nextGroupKey, 10), 42 | ]); `