This is beta documentation for Stream Chat React SDK v14. For the latest stable version, see the latest version (v13)
.
ChannelList Hooks
ChannelList manages a channels state array and updates it using internal hooks. You can’t override the hooks directly, but you can override many event handlers via props. See the ChannelList event listener docs.
Best Practices
- Prefer event handler props over forking internal hooks.
- Keep handler logic lightweight to avoid blocking list updates.
- Align custom behavior with the default hook intent (e.g., list ordering on new messages).
- Use
usePaginatedChannelsbehavior as the model for infinite scrolling. - Avoid direct state mutations; rely on setters or returned handlers.
Hooks
| Hook | Description |
|---|---|
useChannelDeletedListener | A custom hook that handles the deletion of a channel from the list. |
useChannelHiddenListener | A custom hook that handles the hiding of a channel from the list. |
useChannelTruncatedListener | A custom hook that handles when a channel's history is truncated. |
useChannelUpdatedListener | A custom hook that handles when a channel is updated. |
useChannelVisibleListener | A custom hook that handles when a channel is made visible and added to the list. |
useConnectionRecoveredListener | A custom hook that handles when connection is recovered and forces an update of the list. |
useMessageNewListener | A custom hook that handles message.new events and updates the list. |
useMobileNavigation | A custom hook that handles the opening and closing of a mobile navigation via Javascript click event listeners, not Stream events. |
useNotificationAddedToChannelListener | A custom hook that handles when a user is added to the list of channel members, moves the channel to the top of the list, and starts watching. |
useNotificationMessageNewListener | A custom hook that handles when a new message is added to a channel, moves the channel to the top of the list, and starts watching. |
useNotificationRemovedFromChannelListener | A custom hook that handles when a user is removed from the list of channel members and removes the channel from the list. |
usePaginatedChannels | A custom hook that handles pagination and querying channels for the list. |
useUserPresenceChangedListener | A custom hook that handles when a user's status changes, such as going online or offline. |