title: "UseChannel" isDefaultIndex: false
import MemberInfo from '@site/src/components/MemberInfo'; import GenerationInfo from '@site/src/components/GenerationInfo'; import MemberDescription from '@site/src/components/MemberDescription';
Provides access to the ChannelContext which contains information about the active channel.
Example
const { activeChannel } = useChannel();
function useChannel(): void
Provides information about the active channel, and the means to set a new active channel.
interface ChannelContext {
isLoading: boolean;
channels: Channel[];
activeChannel: ActiveChannel | undefined;
setActiveChannel: (channelId: string) => void;
refreshChannels: () => void;
}