-
Notifications
You must be signed in to change notification settings - Fork 97
Description
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.
`
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 | ]);
`