Closed y0unghe closed 8 months ago
I am trying to add a click event to Sprite, but I am getting:
Sprite
Type '{ children: never[]; interactive: boolean; position: { x: number; y: number; }; width: number; height: number; image: string; pointerdown: () => void; }' is not assignable to type 'IntrinsicAttributes & Partial<Omit<Sprite, P | ReadonlyKeys<Sprite> | keyof WithSource> & WithPointLike<P>> & WithSource & InteractionEvents & { ...; } & { ...; }'. Property 'interactive' does not exist on type 'IntrinsicAttributes & Partial<Omit<Sprite, P | ReadonlyKeys<Sprite> | keyof WithSource> & WithPointLike<P>> & WithSource & InteractionEvents & { ...; } & { ...; }'.ts(2322)
Should be able to set the interactive to true
interactive
true
Add the package to create-react-app
"@pixi/react": "^7.1.1",
@pixi/react
pixi.js
React
ReactDOM
No response
In your tsconfig.json, add "esModuleInterop": true, into compilerOptions
"esModuleInterop": true,
let me know if the above does not work and i will reopen the issue
Current Behavior
I am trying to add a click event to
Sprite
, but I am getting:Expected Behavior
Should be able to set the
interactive
totrue
Steps to Reproduce
Add the package to create-react-app
Environment
@pixi/react
version: 7.1.1pixi.js
version: e.g. 7.1.1React
version: 18.2.0ReactDOM
version: 18.2.0Possible Solution
No response
Additional Information
No response