Info:
This is documentation for Stream Chat React Native SDK v3, which is no longer actively maintained. For up-to-date documentation, see the latest version (v9).

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

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

removeImage

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

Type
(index) => void

uploadImage

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

Type
function
Add Chat to my app: getstream.io/SKILL.md

The fastest way to build with Stream. Start a new project or improve an existing one. Full CLI and documentation integration out of the box.


Ask your agent:

/stream Build me a Social App with Feeds and Moderation.
/stream Any livestream calls running?
/stream Chat React Native v3: <Your Question>