Awesome library! I'm running into an error. All I've done is
install bs-socket
Copy Messages.re
Copy BsSocket.Client.make:
MyClient.re
module Client = BsSocket.Client.Make(Messages);
let socket = Client.createWithUrl("http://localhost:3000");
MyClient.bs.js
// Generated by BUCKLESCRIPT, PLEASE EDIT WITH CARE
import * as Curry from "bs-platform/lib/es6/curry.js";
import * as React from "react";
import * as Belt_Array from "bs-platform/lib/es6/belt_Array.js";
import * as Client$BsSocket from "bs-socket/src/Client.bs.js";
import * as Messages$Codenames from "./Messages.bs.js";
var Client = Client$BsSocket.Make(Messages$Codenames);
// ...
function Game(Props) {
var id = Props.id;
React.useEffect((function () {
var socket = io(); <---- BREAKS HERE
console.log(socket);
console.log(id);
return ;
}), ([]));
}
Hey everyone,
Awesome library! I'm running into an error. All I've done is
bs-socket
MyClient.re
MyClient.bs.js
Any help would be appreciated, thank you!
Am I supposed to be importing
io
somewhere?