create-react-phaser3-app
create-react-phaser3-app copied to clipboard
Click on Phaser's button and interact with react state management.
Now it can fire the event to make a game object running on the scene. What if I want to click on a Phaser's object and can interact with React's functions or DOM ?
Hi @korrio, sorry for my late reply.
You can use a state management library like Redux, Zustand, etc that allows you to create store and change React states from anywhere in the client code.
Here's an example from my other project, where I had Redux stores set up and I can dispatch actions to change states within a Phaser scene.
Feel free to let me know if you have more questions!