@casper124578/use-socket.io

Use Socket.io-client with hooks

Usage no npm install needed!

<script type="module">
  import casper124578UseSocketIo from 'https://cdn.skypack.dev/@casper124578/use-socket.io';
</script>

README

use-socket.io

Simple package to use Socket.io with React hooks.

Installation

# npm
npm install @casper124578/use-socket.io

# Yarn
yarn add @casper124578/use-socket.io

# pnpm
pnpm install @casper124578/use-socket.io

Usage

// src/App.tsx

import { SocketProvider } from "@casper124578/use-socket.io";

export default function App() {
  return (
    <SocketProvider uri="http://localhost:3030" options={{}}>
      {/* my app here */}
    </SocketProvider>
  );
}

Documentation

You can view documentation here