<WithComponents overrides={{ ImageComponent: FastImage }}>...</WithComponents>Giphy
Renders Giphy attachments inside MessageList. This is the default component for the Giphy prop.
Best Practices
- Use
handleActionfor approved Giphy actions (send, shuffle, cancel). - Keep Giphy previews lightweight to avoid scroll jank.
- Respect
setOverlay/gallery context for full-screen viewing. - Provide clear affordances for confirming or canceling Giphy sends.
- Use
ImageComponentfromuseComponentsContext()for consistent image handling and caching.
Props
| Prop | Description | Type |
|---|---|---|
attachment | Attachment object for a giphy type attachment. | object |
additionalPressableProps | Extra props passed to the underlying Pressable used in message components like MessageContent. | object |
handleAction | Sends an attachment action on a message (for example, Giphy Shuffle/Cancel/Send). | (name: string, value: string) => Promise |
onLongPress | Default long press handler for message UI. | function |
onPress | Default press handler for message UI. | function |
onPressIn | Default pressIn handler for message UI. | function |
setSelectedMessage | Setter for value selectedMessage. | (selectedMessage: {messageId?: string; url?: string;}) => void |
setMessages | Setter for value messages. | (messages: LocalMessage[]) => void |
setOverlay | Setter for overlay. You can use this setter to show the overlay. | (overlay) => void |
ImageComponent is provided through WithComponents. To use a custom image component (e.g. for caching):