proyecto26 / ion-phaser

A web component to use Phaser Framework with Angular, React, Vue, etc 🎮
https://market.ionicframework.com/plugins/ionphaser
MIT License
252 stars 39 forks source link

Support React v17 #45

Open i3z0x1 opened 2 years ago

i3z0x1 commented 2 years ago

We have to upgrade this package support React latest version v17.0.2.

As I have an error installing this dependencies using NPM. Fix the upstream dependency conflict


npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! While resolving: myapp@2.0.4
npm ERR! Found: react@17.0.2
npm ERR! node_modules/react
npm ERR!   react@"17.0.2" from the root project
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^16.7.0" from @ion-phaser/react@1.3.0
npm ERR! node_modules/@ion-phaser/react
npm ERR!   @ion-phaser/react@"*" from the root project
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.```
i3z0x1 commented 2 years ago

Another Error while try get component <IonPhaser ref={gameRef} game={game} initialize={initialize} />

ExceptionsManager.js:149 Invariant Violation: View config getter callback for component `ion-phaser` must be a function (received `undefined`). Make sure to start component names with a capital letter.

jdnichollsc commented 2 years ago

Hello mate, thanks for reporting this issue!

Very odd, let me check! in the meantime, you can try using a hook approach instead: https://stackblitz.com/edit/react-phaser

Best Regards, Juan

rsodre commented 2 years ago

Same happens to me, using react@18.2.0