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 undefined when channel is unavailable.
  • Keep derived booleans memoized in large list rows.
  • Avoid duplicating membership state in local component state.

Usage

import { useChannelMembershipState } from "stream-chat-react-native";

const membership = useChannelMembershipState(channel);
const isArchived = Boolean(membership?.archived_at);

Parameters

Name Type Required Description
channel Channel No Channel whose membership is read.

Returns

Type Description
ChannelMemberResponse | undefined Membership data for the current user.
Add Chat to my app: getstream.io/SKILL.md

The fastest way to build with Stream. Start a new project or improve an existing one. Full CLI and documentation integration out of the box.


Ask your agent:

/stream Build me a Social App with Feeds and Moderation.
/stream Any livestream calls running?
/stream Chat React Native v9: <Your Question>