Dev-CasperTheGhost / use-socket.io

Simple package to use Socket.io with React hooks.

Home Page:http://npm.im/@casper124578/use-socket.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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={
        {
          /** ... */
        }
      }
    >
      <App />
    </SocketProvider>
  );
}

Documentation

You can view documentation here

About

Simple package to use Socket.io with React hooks.

http://npm.im/@casper124578/use-socket.io

License:MIT License


Languages

Language:TypeScript 100.0%