Property 'of' does not exist on type 'Socket<DefaultEventsMap, DefaultEventsMap>'.
Describe the bug
i can't find the of property to defined a namespace also cant find socket.to ... to send to specific room >.<
To Reproduce
Socket.IO client version: ^4.7.2
Client
import io from 'socket.io-client';
const socket = io({
transports: ['websocket'],
autoConnect: true,
})
socket.of....
Expected behavior wanted to have autocomplete on all methods like in the docs .
Platform:
- mac
Additional context it s about typescript or idk I tried to install @types but same result ....
Hi!
socket.to() and io.of() are available on the server side, not the client side.
Reference: https://socket.io/docs/v4/server-api/
thank u for answering :) im using python on the server side, okey so yeah from the server side I know how to do it, but from client side how can I pick a namespace and a room ? is there something I'm missing. Because I was looking at https://socket.io/docs/v4/namespaces/ and there was nothing mentioning it s server side. Am I understanding it correctly ? thank u for ur pacience
because on python i have the emit function with kwargs and have room , namespace but in client ... i have only emit with first arg event name and second the data I'm sending :-?
so for u to understand my flow: every time a user logs in he makes a emit on the connected event and then from the server side i join him on the notifications namespace and a specific room, somehome there must me o possibility to send data only to that specific room, and listen to that specific room, something opposite to broadcast, how can i make this ? ps: be is fully functional, I don't know how to do it from client
i think i understand so the be is the source of truth, so when I say send it to room = x on the client when I listen it will send only to the rooms that I joined from the be