Documentation / @agentick/react / useConnectionState
Function: useConnectionState() ​
useConnectionState():
ConnectionState
Defined in: react/src/hooks/use-connection.ts:28
Subscribe to connection state changes.
Returns ​
Example ​
tsx
import { useConnectionState } from '@agentick/react';
function ConnectionIndicator() {
const state = useConnectionState();
return (
<div className={`indicator ${state}`}>
{state === 'connected' ? 'Online' : 'Offline'}
</div>
);
}