A React hook that manages NATS WebSocket client connection lifecycle with automatic connection management and status tracking. ## Key Components - **`useNatsClient`** - Main hook that creates and manages a NATS client instance - **`UseNatsClientOptions`** - Configuration interface with `autoConnect` option - **`UseNatsClientResult`** - Return type containing client, status, connection state, and error information ## Usage Example ```typescript import { useMemo } from 'react' import { useNatsClient } from './use-nats-client' function MyComponent() { // Memoize options to prevent reconnections on re-render const clientOptions = useMemo(() => ({ url: 'ws://localhost:4222', timeout: 5000 }), []) const { client, status, isConnected, lastError } = useNatsClient( clientOptions, { autoConnect: true } ) if (lastError) { return