import {
OverlayProvider,
Chat,
ChannelDetailsContextProvider,
PinnedMessageList,
} from "stream-chat-react-native";
const App = () => {
return (
<OverlayProvider>
<Chat client={client}>
<ChannelDetailsContextProvider channel={channel}>
<PinnedMessageList />
</ChannelDetailsContextProvider>
</Chat>
</OverlayProvider>
);
};PinnedMessageList
A searchable, paginated list of a channel's pinned messages. It fetches the pinned messages, renders them in a FlatList with infinite scroll, and shows an empty state when there are none. Needs to be wrapped in a ChannelDetailsContextProvider that supplies the channel.
This is the list surfaced by the navigation section of ChannelDetails. You can render it on its own screen as well.

Best Practices
- Wrap it in
ChannelDetailsContextProviderso it can resolve the channel to query. - Use
additionalFlatListPropsto tune scrolling and performance instead of wrapping the list. - Pass
formatMessageDatethrough the item when you need a custom date format in the preview. - Override and configure the
PinnedMessageItembuilding block by wrapping the list inWithComponentswith anoverridesmap.
General Usage
Props
| Prop | Description | Type |
|---|---|---|
additionalFlatListProps | Override the underlying FlatList props of the list. | Partial<FlatListProps<MessageResponse>> |
searchInputProps | Additional props forwarded to the search input. | SearchInputProps |
searchSource | A custom MessageSearchSource used to query and paginate the pinned messages. Overrides the source created by default (pre-configured to fetch pinned messages). | MessageSearchSource |
Building blocks
PinnedMessageItem
The row rendered for each pinned message.
| Prop | Description | Type |
|---|---|---|
channel * | The channel the pinned message belongs to. | Channel |
message * | The pinned message to render. | MessageResponse |
formatMessageDate | Optional function to format the message date in the preview. | (date: Date) => string |