You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was wondering if this socket.io library was compatible with JavaScript frameworks like React, Vue or Svelte, because JavaScript code written in an HTML file works perfectly fine, but applying the same code to a basic React or Svelte frontend doesn't yield the same results. The connection is made successfully, but messages are not coming through.
The text was updated successfully, but these errors were encountered:
First, you need to use npm i socket.io in your blank Vue/React/Svelte since you are not using cdn links but the npm package. Socket.io is a basic websocket package with some convenient utility functions for creating rooms and lobbies. Next, you import in your main.ts this socket.io package and provide it to your app. From there, you have Vue/React/Svelte life cycle hooks you can use to send events and receive events.
I was wondering if this socket.io library was compatible with JavaScript frameworks like React, Vue or Svelte, because JavaScript code written in an HTML file works perfectly fine, but applying the same code to a basic React or Svelte frontend doesn't yield the same results. The connection is made successfully, but messages are not coming through.
The text was updated successfully, but these errors were encountered: