pixijs / pixi-react

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

Bug: Migration from inlet/react-pixi to @pixi/react #421

Closed michael-motornyi closed 1 year ago

michael-motornyi commented 1 year ago

Current Behavior

After migration i am receiving an error image

Expected Behavior

Pixi React should work as expected from examples

Steps to Reproduce

Change inlet/react-pixi to @pixi/react in package json and update all imports on your project

image

Environment

Vite as bundler

"@pixi/react": "^7.0.2", "pixi.js": "^7.1.4", "react": "18.2.0", "react-dom": "18.2.0", "vite": "^4.0.3",

Possible Solution

No response

Additional Information

No response

baseten commented 1 year ago

@michael-motornyi are you seeing this in an existing project or in the minimal example you've provided above? Stage does expect to have some children for example. If you're using React 18, you should also use the new createRoot API rather than React DOM render: https://reactjs.org/blog/2022/03/08/react-18-upgrade-guide.html#updates-to-client-rendering-apis

If neither of these work, are you able to provide a minimal reproduction on CodeSandbox and I can take a look for you