This is an Expo project created with create-expo-app
.
Just a simple example of how to use the Expo DOM Component with Phaser.
It leverages from the experimental useDOMImperativeHandle to pass the game functions (DOM component) to the parent component (native).
The UI (buttons and score) is implemented with React Native components, while the game itself runs with Phaser within a DOM component.
This example partly follows the Phaser tutorial, but was modified (e.g. no usage of keyboard) so that it could be used to run on mobile devices. I didn't implement it all as I just really wanted to try the useDOMImperativeHandle out, and this was a fun way to do it.
It runs with Expo Go (only tested it on iOS).
Check out Expo and Phaser if you're interested to learn more.