Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maximum update depth exceeded. #579

Open
longhonour opened this issue Nov 11, 2024 · 0 comments
Open

Maximum update depth exceeded. #579

longhonour opened this issue Nov 11, 2024 · 0 comments

Comments

@longhonour
Copy link

longhonour commented Nov 11, 2024

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 | ]);
`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant