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: (v8) having both react-three-fiber and pixi-react yield incompatibility errors #549

Open
rvion opened this issue Oct 20, 2024 · 1 comment
Labels
v8 Issues related to Pixi React v8

Comments

@rvion
Copy link

rvion commented Oct 20, 2024

Current Behavior

having both react-three-fiber and pixi-react yield incompatibility errors

Interface 'IntrinsicElements' cannot simultaneously extend types 'ThreeElements' and 'PixiElements'.
  Named property 'color' of types 'ThreeElements' and 'PixiElements' are not identical.

Expected Behavior

no errors

Steps to Reproduce

install both pixi-react beta, pixi v8, and latest react three fiber

Environment

  • @pixi/react version: ^8.0.0-beta.14
  • pixi.js version: e.g. 8.2.1
  • React version: e.g. 18.3.1
  • ReactDOM version: e.g. 18.3.1
  • Browser & Version: e.g. Electron latest
  • OS & Version: e.g. MacosM1
  • Running Example: e.g. https://pixiplayground.com/

Possible Solution

remove non-prefixed variatns from IntrinsicElements (I subjectively prefer to avoid conflicts, and promote only having <pixi... /> prefixed components

Additional Information

thanks for the amazing lib

@rvion
Copy link
Author

rvion commented Oct 25, 2024

IMO a good solution would be to change the global.d.ts to something like that, and only tell people they can extend IntrinsincElements with PixiElement if they really want to.

They anyway are often going to need to deal with tweaking some global.d.ts if they want to use custom packages like pixi-viewport

import type { NamespacedPixiElements } from './typedefs/NamespacedPixiElements';
// import type { PixiElements } from './typedefs/PixiElements';
declare global {
    namespace JSX {
        interface IntrinsicElements extends /* PixiElements, */ NamespacedPixiElements {
        }
    }
}

@trezy trezy added the v8 Issues related to Pixi React v8 label Nov 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
v8 Issues related to Pixi React v8
Projects
None yet
Development

No branches or pull requests

2 participants