# useChannelUpdated

Subscribes to `channel.updated` events and applies channel updates to your `ChannelList` state.

## Best Practices

- Use this hook where channel list state (`setChannels`) is owned.
- Provide a custom `onChannelUpdated` only when default update behavior is insufficient.
- Keep custom update handlers idempotent and side-effect free.
- Avoid mutating the previous channels array directly in custom handlers.
- Use this hook once per list state owner to prevent duplicate updates.

## Usage

```tsx
import { useChannelUpdated } from "stream-chat-react-native";

useChannelUpdated({
  setChannels,
  onChannelUpdated: (setChannels, event) => {
    setChannels(
      (channels) =>
        channels?.map((channel) =>
          channel.cid === (event.cid || event.channel?.cid) ? channel : channel,
        ) ?? channels,
    );
  },
});
```

## Parameters

| Name             | Type                                                      | Required | Description                                |
| ---------------- | --------------------------------------------------------- | -------- | ------------------------------------------ |
| setChannels      | `React.Dispatch<React.SetStateAction<Channel[] \| null>>` | Yes      | State setter for channel list data.        |
| onChannelUpdated | `(setChannels, event) => void`                            | No       | Optional custom `channel.updated` handler. |


---

This page was last updated at 2026-04-17T17:33:46.138Z.

For the most recent version of this documentation, visit [https://getstream.io/chat/docs/sdk/react-native/hooks/channel-list/use-channel-updated/](https://getstream.io/chat/docs/sdk/react-native/hooks/channel-list/use-channel-updated/).