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: issues with interactivity if you never import pixi.js #463

Closed
johnfn opened this issue Nov 22, 2023 · 1 comment · Fixed by #478
Closed

Bug: issues with interactivity if you never import pixi.js #463

johnfn opened this issue Nov 22, 2023 · 1 comment · Fixed by #478

Comments

@johnfn
Copy link

johnfn commented Nov 22, 2023

Current Behavior

If you try to use interactivity-related stuff in pixi-react, you'll get a typescript error. For instance, trying to set interactive={true} or eventMode="static" doesn't work.

Expected Behavior

It should work :)

Steps to Reproduce

Create a new project with pixi-react. DO NOT EVER IMPORT pixi.js.

Environment

"dependencies": {
"@pixi/react": "^7.1.1",
"next": "14.0.3",
"pixi.js": "^7.3.2",
"react": "^18",
"react-dom": "^18"
},

  • Browser & Version: Latest Chrome
  • OS & Version: MacOS latest

Possible Solution

There is a straightforward but non-obvious workaround to this problem: add an import to pixi.js anywhere in your project.

I think this is because pixi.js extends some shared mixin interfaces.

Additional Information

No response

@Yuma-Satake
Copy link

Yuma-Satake commented Nov 30, 2023

@johnfn
import '@pixi/events';
Inserting an import statement prevents errors from occurring in static analysis.
However, even if interactivity is enabled, click events, etc. are not enabled.
I'm having the same problem.

@Zyie Zyie linked a pull request Mar 20, 2024 that will close this issue
@Zyie Zyie closed this as completed in #478 Mar 20, 2024
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 a pull request may close this issue.

2 participants