-
-
Notifications
You must be signed in to change notification settings - Fork 68
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
bug: rerender causes leak for shot cubes #99
Comments
Refresh the browser after making code changes |
I'm aware of the refresh workaround, however i was thinking of a fix for the leak by probably getting rid of the useState for the cubes and rendering them imperatively. this should solve the issue and even have better performance since the component no longer rerenders needlessly. |
That’s just an example, you can improve it however you like in your app. Another improvement could be using instanced cubes |
thanks for the idea, i'm just trying to see what we can do to include good practices as many people will probably use the example as a starting point. |
@ErdongChen-Andrew turns out the issue was an incorrect function reference in the event listener |
https://github.com/pmndrs/ecctrl/blob/main/example/ShotCube.tsx
Screen.Recording.2024-09-16.at.2.35.28.PM.mp4
The text was updated successfully, but these errors were encountered: