Skip to content

Commit

Permalink
fix: use proper config for official devtools
Browse files Browse the repository at this point in the history
  • Loading branch information
trezy committed Jun 25, 2024
1 parent 5f642a6 commit 908514a
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions src/components/Application.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,23 @@ export const ApplicationFunction = (props, forwardedRef) =>

useEffect(() =>
{
if (attachToDevTools && applicationRef.current)
const application = applicationRef.current;

if (attachToDevTools && application)
{
const globalScope = /** @type {*} */ (globalThis);

globalScope.__PIXI_APP__ = applicationRef.current;
globalScope.__PIXI_DEVTOOLS__ = applicationRef.current;
globalScope.__PIXI_APP__ = application;

import('pixi.js').then((pixi) =>
{
globalScope.__PIXI_DEVTOOLS__ = {
app: application,
pixi,
renderer: application.renderer,
stage: application.stage,
};
});
}
}, [attachToDevTools]);

Expand Down

0 comments on commit 908514a

Please sign in to comment.