Skip to content
zenui/react-hooks

useWebSocket

Connect to a WebSocket and track its status, the latest message and reconnect attempts. Use it for chat, live dashboards and multiplayer state when you need reconnects, heartbeats and a send queue without writing the socket lifecycle yourself.

Level
Advanced
Since
v2.1.0
import {useWebSocket} from '@zenuilabs/react-hooks';
Loading demo_

More in Realtime