Skip to main content

UseChannel

Provides access to the ChannelContext which contains information about the active channel.

Example

Tsx
const { activeChannel } = useChannel();
Signature
function useChannel(): void

Provides information about the active channel, and the means to set a new active channel.

Signature
interface ChannelContext {    isLoading: boolean;    channels: Channel[];    activeChannel: ActiveChannel | undefined;    setActiveChannel: (channelId: string) => void;    refreshChannels: () => void;}

isLoading

propertyboolean

Whether the channels are loading.

channels

propertyChannel[]

An array of all available channels.

activeChannel

propertyActiveChannel | undefined

The active channel.

setActiveChannel

property(channelId: string) => void

The function to set the active channel.

refreshChannels

property() => void

The function to refresh the channels.

Was this chapter helpful?
Report Issue
Edited Feb 2, 2026·Edit this page