Skip to content

Debug with PixiJS Devtools? #629

@kaloyan-manev-ph

Description

@kaloyan-manev-ph

Hi,

Today I tried to link the Chrome Extension Devtools https://pixijs.io/devtools/ with my react app. However, it was really difficult, is this the right way to do it?

Here's how I did it (this works):

const application = useApplication();
(globalThis as unknown as {__PIXI_APP__: Application<Renderer>}).__PIXI_APP__ = application.app;

Here's what I tried but it didn't work, (I also tried multiple other combinations e.g. without useEffect):

const application = useApplication();
useEffect(() => {
    initDevtools({ app: application.app});
}, [application.app]);

I expect that the second piece of code should work but I had to rely on globalThis... Is this how it is supposed to be?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions