Skip to content

[QUESTION] Why does a state change cause the render loop to fail even when the state isn't used by Canvas? #3534

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

Open
varshithmee opened this issue May 21, 2025 · 0 comments

Comments

@varshithmee
Copy link

varshithmee commented May 21, 2025

Hi,

I followed the tutorial from this incredible blog and added my TypeScript tweaks to it.

It works perfectly on its own.

The issue starts when I add state to the other parts of the app. For example, using a simple useMouse hook in the parent component causes the render loop to fail if I move the mouse. Even Zustand state change causes the render loop to fail.

Below example shows zustand state changing when mouse hover the text.

20250521-1022-21.6067807.mp4

My immediate solution was to memoise the scene component, and it works, but I do not understand why it causes the render loop to fail in the first place.

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