You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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".
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.
@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.
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
@pixi/react
version: 8.0.0-beta.7pixi.js
version: 8.3.1React
version: 18.2.0ReactDOM
version: 18.2.0Possible 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
The text was updated successfully, but these errors were encountered: