GuidesComponentsSocket

Socket types and context

Public types for the socket provider and its context

  • Stable unknown
  • Release candidate since 1.16.1-rc.3
  • Development since 1.16.1-dev.2111+9796905

The socket subpath exports SocketContext, SocketContextType, and SocketLogPayload.

TypePurpose
SocketContextTypeThe current Socket.IO instance, when connected, and isConnected.
SocketLogPayloadServer log event with message and level (info, warn, or error).

SocketProvider accepts optional connect, disconnect, error, ping, and log callbacks. Its internal props type is not separately exported from the package.

Use useSocket for normal consumption. SocketContext is exported for advanced integrations, but direct context access couples a component to the provider shape.

Last updated on