pixijs / pixi-react

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

Error: "(alias) const Container: React.FC<_ReactPixi.IContainer> import Container Type '{ children: Element; x: number; y: number; }' is not assignable to type 'IntrinsicAttributes & Partial<Omit<Container<DisplayObject>" #353

Closed adnanlah closed 1 year ago

adnanlah commented 1 year ago

Description

I get this error when I try this example:

image

import { Stage, Sprite, Container } from "@inlet/react-pixi";

function MapDisplay() {
  return (
    <div>
      <Stage width={300} height={300} options={{ backgroundAlpha: 0 }}>
        <Container x={150} y={150}>
          <Sprite image="https://s3-us-west-2.amazonaws.com/s.cdpn.io/693612/IaUrttj.png" />
        </Container>
      </Stage>
    </div>
  );
}

export default MapDisplay;

Steps to reproduce

  1. install @inlet/react-pixi and pixi.js in a Vite react app.
  2. Try a small example in a React component.

Additional info

saitonakamura commented 1 year ago

@plantain-00 @jdlee022 You can use @saitonakamura/react-pixi@17.0.0-beta-5, it has support for react 18 and we've being using it in production for a month

baseten commented 1 year ago

React 18 support has landed in the latest alpha v7.0.0-alpha.0. Please install from @pixi/react-pixi