Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save efstathiosntonas/ce4d8cea1936a65c99ef49bf75717c08 to your computer and use it in GitHub Desktop.
Save efstathiosntonas/ce4d8cea1936a65c99ef49bf75717c08 to your computer and use it in GitHub Desktop.
System and custom message react native gifted chat
import {
GiftedChat,
SystemMessage,
// ...all other imports
} from "react-native-gifted-chat
<GiftedChat
// ...all other stuff
renderSystemMessage={(systemMessage) => {
// @ts-ignore
const feed: Doc<Feed> = systemMessage.currentMessage.feed;
if (feed != null) {
return <FeedInChat feed={feed} time={time} date={date} />;
}
return <SystemMessage {...systemMessage} />;
}}
user={{
_id: currentUser().uid
}}
/>
</GiftedChat>
// ^^ FeedInChat is a custom component, you can use whatever you want
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment