@casperiv/use-socket.io
v6.0.1
Published
Use Socket.io-client with hooks
Downloads
317
Maintainers
Readme
use-socket.io
Simple package to use Socket.io with React hooks.
Installation
# npm
npm install @casperiv/use-socket.io
# Yarn
yarn add @casperiv/use-socket.io
# pnpm
pnpm install @casperiv/use-socket.io
Usage
// src/App.tsx
import { SocketProvider } from "@casperiv/use-socket.io";
export default function App() {
return (
<SocketProvider
uri="http://localhost:3030"
options={
{
/** ... */
}
}
>
<App />
</SocketProvider>
);
}