Replies: 2 comments
-
I have the same issue. Did you figure it out @pjchungmd ? |
Beta Was this translation helpful? Give feedback.
0 replies
-
Hi! That's weird, were you able to find the culprit? Reference: https://socket.io/how-to/use-with-react |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I am trying to integrate Socket IO (v3.1.1) with my react app. I am able to make a connection between the client and server. I have a button event handler that does the following:
The server has the following code:
Back on the client side, after confirming that the socket connection is created, I have the following code:
So when I press the button, I see "Button pressed" on my server's console, and "Roger that!" on my client's console. However the
msg
state variable is not updated. What is going? How can I get the state variable to be updated in response to emitted messages?Beta Was this translation helpful? Give feedback.
All reactions