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

fix maximum update depth exceeded issue #113

Merged
merged 1 commit into from
Oct 30, 2023

Conversation

poorneshhn
Copy link
Contributor

@poorneshhn poorneshhn commented Oct 28, 2023

I saw this issue on stackoverflow [https://stackoverflow.com/questions/77380011/simple-component-in-react-chessboard-is-causing-constant-maximum-update-depth-e].

The issue is,

  • when the Chessboard component is imported and mounted on the DOM, there is a "maximum update depth exceeded" error.

since metrics variable which is an object is given as a dependency to useEffect which in turn sets a state variable, there was infinite re-render.

Attaching a screenshot for your reference.
chessboard-rerender-issue

@vercel
Copy link

vercel bot commented Oct 28, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
react-chessboard ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 28, 2023 7:02pm

@Clariity Clariity merged commit b118b78 into Clariity:main Oct 30, 2023
2 checks passed
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

Successfully merging this pull request may close these issues.

2 participants