5

I am using React Native Gifted Chat for one of my project. I am aware that there is a image option available where I can attach a single image to a chat. But, is there a way I can attach multiple images to a single chat?

1 Answers1

0

from documentation, the type of image is a string. so it's meant to attach one image. but a simple solution is to do like image:"img1,img2,.." , then use

renderMessageImage={(props)=> customMessageImages(props)} 

where

customMessageImages=(props:MessageImageProps<IMessage>)=>{
   const imgs = props.image.split(',')
   return(
      {
         imgs.map(img=>(
            <Image source={img} />
         ))
       }
   )
}
Hemza Talha
  • 79
  • 1
  • 3