Skip to main content
Version: v3

FileUploadPreview

FileUploadPreview is the default UI component for rendering a preview of attached file within MessageInput component.

Props

overrides the value from MessageInputContext
fileUploads

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

[
{
file: {
name: 'test.pdf';
size: 2000;
type: 'application/pdf';
uri: 'file-uri';
};
id: 'asdas232bk3jb42k3';
state: 'uploaded'; // or 'finished'
url: 'https://cdn.getstream.io/kajsnkj2n3j4';
}
]
Type
array

overrides the value from MessageInputContext
removeFile

Removes attached file in message, which is being composed in MessageInput component. By default, this function is attached to onPress handler for close button in FileUploadPreview. It takes index of file (to be removed) in fileUploads array as parameter.

Type
(index) => void

overrides the value from MessageInputContext
uploadFile

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

Type
function

Did you find this page helpful?