import { useCanEditChannel } from "stream-chat-react-native";
const canEdit = useCanEditChannel(channel);useCanEditChannel
Returns whether the current user can edit (update) the channel.
It checks for the update-channel capability via useChannelOwnCapabilities and reacts to capabilities.changed events.
Best Practices
- Use this hook to show or hide edit affordances (e.g. an "Edit" button on a channel details screen).
- Treat the result as the single source of truth for edit permission rather than duplicating the capability check.
- The hook returns
falsewhen capabilities are unavailable, so it is safe to render-gate on directly.
Usage
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| channel | Channel | No | Channel to evaluate for edit permission. |
Returns
| Type | Description |
|---|---|
boolean | Whether the current user can edit the channel. |