import {
ChannelLastMessagePreview,
ChannelList,
} from "stream-chat-react-native";
const CustomPreviewMessage = ({ lastMessage }) => {
if (!lastMessage) return null;
return <ChannelLastMessagePreview message={lastMessage} />;
};
const App = () => {
return <ChannelList PreviewMessage={CustomPreviewMessage} />;
};This is beta documentation for Stream Chat React Native SDK v9. For the latest stable version, see the latest version (v8)
.
ChannelLastMessagePreview
Renders icon + text for the latest message preview in a channel row. This component is used by ChannelPreviewMessage to render the final preview content.
Best Practices
- Keep preview text short and single-line for stable list row height.
- Use semantic text colors so deleted and normal messages are clearly differentiated.
- Avoid heavy formatting logic inside render for large channel lists.
- Keep icon usage consistent with the message type being previewed.
- Reuse this component when customizing
ChannelPreviewMessageto preserve SDK behavior.
General Usage
Use it when overriding PreviewMessage through ChannelList.
Props
message
Message object used to generate the preview icon and text.
| Type |
|---|
LocalMessage | MessageResponse | DraftMessage |