pixijs / pixi-react

Write PIXI apps using React declarative style
https://pixijs.io/pixi-react/
MIT License
2.24k stars 172 forks source link

Bug: interactive does not exist #456

Closed y0unghe closed 3 months ago

y0unghe commented 9 months ago

Current Behavior

I am trying to add a click event to Sprite, but I am getting:

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)

Expected Behavior

Should be able to set the interactive to true

Steps to Reproduce

Add the package to create-react-app

    "@pixi/react": "^7.1.1",

Environment

Possible Solution

No response

Additional Information

No response

augusttty commented 7 months ago

In your tsconfig.json, add "esModuleInterop": true, into compilerOptions

Zyie commented 3 months ago

let me know if the above does not work and i will reopen the issue