import { useChannelMembershipState } from "stream-chat-react-native";
const membership = useChannelMembershipState(channel);
const isArchived = Boolean(membership?.archived_at);This is beta documentation for Stream Chat React Native SDK v9. For the latest stable version, see the latest version (v8)
.
useChannelMembershipState
Reads channel.state.membership reactively for channel-list UI decisions.
Best Practices
- Use this hook to drive membership-specific UI (pinned, archived, etc.).
- Treat the return value as read-only state from the channel store.
- Handle
undefinedwhen channel is unavailable. - Keep derived booleans memoized in large list rows.
- Avoid duplicating membership state in local component state.
Usage
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| channel | Channel | No | Channel whose membership is read. |
Returns
| Type | Description |
|---|---|
ChannelMemberResponse | undefined | Membership data for the current user. |