useIsChannelPinned

Returns whether the current user has pinned the channel and keeps it in sync with member.updated events.

Best Practices

  • Use this hook instead of reading channel.state.membership.pinned_at directly in render.
  • Read the returned boolean for badge and ordering decisions.
  • Keep pinned indicators subtle and consistent across channel previews.
  • Avoid duplicating membership event listeners in custom list components.
  • Handle the default unpinned state while initial membership data is syncing.

Usage

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

const PinnedIndicator = ({ channel }: { channel: Channel }) => {
  const pinned = useIsChannelPinned(channel);
  return pinned ? <Text>Pinned</Text> : null;
};

Parameters

NameTypeRequiredDescription
channelChannelYesChannel whose pinned status is observed.

Returns

TypeDescription
booleanWhether the channel is currently pinned.