I want to use the socket.io-client library from nodejs in my React-Kotlin project.
I tried to load it like this:
@file:JsModule("socket.io-client")
@file:JsNonModule
package modules
@JsName("Manager")
external fun socket(uri: String): dynamic
Then client will connect to the server when I call it with this function val s = socket("http://localhost:8080/")
but when I call an emit like this s.emit("testemit", mapOf("test" to false))
it doesn't send it.
If I change s.emit
to something else that does not exist in socket.io-client, I get an error message that the function does not exist.