Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Click on Phaser's button and interact with react state management. #11

Open
korrio opened this issue Nov 20, 2022 · 1 comment
Open

Comments

@korrio
Copy link

korrio commented Nov 20, 2022

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 ?

@kevinshen56714
Copy link
Owner

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants