Simple package to use Socket.io with React hooks.
MIT License
Simple package to use Socket.io with React hooks.
# npm
npm install @casperiv/use-socket.io
# Yarn
yarn add @casperiv/use-socket.io
# pnpm
pnpm install @casperiv/use-socket.io
// src/App.tsx
import { SocketProvider } from "@casperiv/use-socket.io";
export default function App() {
return (
<SocketProvider
uri="http://localhost:3030"
options={
{
/** ... */
}
}
>
<App />
</SocketProvider>
);
}