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

Bug: v8 memoized component renders after being unmounted #521

Open
CaptainStiggz opened this issue Aug 7, 2024 · 2 comments
Open

Bug: v8 memoized component renders after being unmounted #521

CaptainStiggz opened this issue Aug 7, 2024 · 2 comments
Assignees
Labels
v8 Issues related to Pixi React v8

Comments

@CaptainStiggz
Copy link

CaptainStiggz commented Aug 7, 2024

Current Behavior

If I create a memoized component which renders a pixi element, that component will continue to render even after it is unmounted. I believe this only happens when using proxy state, but don't quote me on that. Code sandbox link in the repro steps below.

Expected Behavior

An unmounted component does not render anymore.

Steps to Reproduce

https://codesandbox.io/p/sandbox/holy-dust-4tyfdv

If you click the "change color" button, you'll see the graphics element change color as expected. The strange part is when you click "unmount" to unmount the entire pixi application, then click the change color button with the console open, you will see it log "render square".

Environment

Possible Solution

https://valtio.pmnd.rs/docs/how-tos/some-gotchas

Additional Information

This uses the valtio library for proxy state. It does not appear to be a problem with the library, as if I remove pixi and render simple html, the problem does not persist.

https://valtio.pmnd.rs/docs/introduction/getting-started

@trezy trezy added bug Something isn't working v8 Issues related to Pixi React v8 labels Aug 16, 2024
@trezy trezy self-assigned this Aug 16, 2024
@CaptainStiggz
Copy link
Author

CaptainStiggz commented Sep 24, 2024

@trezy @lunarraid @thejustinwalsh I see there's a PR for this issue #542 - curious what's the hold up. Anything I can do to help? Possible to get some pretty nasty memory leaks (especially in safari), since the application is not destroyed on unmount. Anticipating this PR will fix that.

@itsezc
Copy link

itsezc commented Nov 4, 2024

I have a very similar issue here, and can confirm its with Memoization (also using Valtio)!

@trezy trezy removed the bug Something isn't working label Dec 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
v8 Issues related to Pixi React v8
Projects
None yet
Development

No branches or pull requests

3 participants