Skip to content

feat: Add Application onDestroy prop#643

Open
zenblender wants to merge 2 commits into
pixijs:mainfrom
zenblender:on-destroy
Open

feat: Add Application onDestroy prop#643
zenblender wants to merge 2 commits into
pixijs:mainfrom
zenblender:on-destroy

Conversation

@zenblender

Copy link
Copy Markdown
Contributor

Adds a new onDestroy prop on <Application>.

Unmounting of roots is an asynchronous process, so I thought it would be a good idea to provide this mechanism so the consumer will be notified when the underlying Pixi.js application has indeed been destroyed. This can help in cases where specific or additional clean-up is needed once the Pixi.js application(s) are no longer running.

@pkg-pr-new

pkg-pr-new Bot commented Jan 17, 2026

Copy link
Copy Markdown
npm i https://pkg.pr.new/pixijs/pixi-react/@pixi/react@643

commit: a37cc86

@thejustinwalsh thejustinwalsh requested a review from trezy January 25, 2026 14:48
@thejustinwalsh

Copy link
Copy Markdown
Collaborator

Looking good!

I am guessing adding the onDestroy function to the application state was the cleanest way to route it to the proper place for being called? Are users going to expect that we take a ref to this function or do we need to track it in depenedencies?

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