Hey! Sorry about the late response.
I'm going to assume that you're asking about where to put socket.on() on the client app (which im also assuming is in react).
I'm also going to assume you aren't using hooks since this tutorial did not have hooks (hooks are awesome btw)
If both of these are valid, you can add the "listener" to a components componentDidMount lifecycle method, just like I did above.
You can read more about the method here: reactjs.org/docs/react-component.h...
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Hey! Sorry about the late response.
I'm going to assume that you're asking about where to put socket.on() on the client app (which im also assuming is in react).
I'm also going to assume you aren't using hooks since this tutorial did not have hooks (hooks are awesome btw)
If both of these are valid, you can add the "listener" to a components componentDidMount lifecycle method, just like I did above.
You can read more about the method here: reactjs.org/docs/react-component.h...