import { useCanAddMembersToChannel } from "stream-chat-react-native";
const canAddMembers = useCanAddMembersToChannel(channel);useCanAddMembersToChannel
Returns whether the current user can add members to the channel.
It checks for the update-channel-members capability via useChannelOwnCapabilities and reacts to capabilities.changed events.
Best Practices
- Use this hook to show or hide "Add members" affordances on channel details and member-management screens.
- Treat the result as the single source of truth for the add-members 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 add-members permission. |
Returns
| Type | Description |
|---|---|
boolean | Whether the current user can add members to the channel. |