Skip to main content
Version: v5

ImageUploadPreview

ImageUploadPreview is the default UI component for rendering a preview of attached image within MessageInput component.

You can replace this default UI component using the ImageUploadPreview prop on Channel component.

<Channel ImageUploadPreview={CustomImageUploadPreview} />

Props

overrides the value from MessageInputContext
imageUploads

List of image type attachments currently attached to message, which is being composed in MessageInput component.

[
{
file: { name: 'fallback-name.jpeg' },
id: '2j3n4k23nj4k23n4k3',
state: 'finished', // or 'uploading'
url: 'https://cdn.getstream.io/kajsnkj2n3j4', // If the state is `uploading`, then this will be a local uri of image.
},
];
Type
Array

overrides the value from MessageInputContext
removeImage

Removes an attached image in a message being composed in the MessageInput component. By default, this function is attached to onPress handler for close button in ImageUploadPreview. It takes a string ID of the image to be removed in the imageUploads array as parameter.

Type
(id: string) => void

overrides the value from MessageInputContext
uploadImage

This function is used internally by uploadNewImage function, and is used for purpose retry mechanism.

Type
Function

Did you find this page helpful?