Custom rendering of item
renderItem
: Function, custom item rendering-
As a prop on a specific item
[{thumbnail: '...', renderItem: '...'}]
-
As a prop passed into
ImageGallery
to completely override_renderItem
, see original below_renderItem(item) { const onImageError = this.props.onImageError || this._handleImageError return ( <div className='image-gallery-image'> <img src={item.original} alt={item.originalAlt} srcSet={item.srcSet} sizes={item.sizes} onLoad={this.props.onImageLoad} onError={onImageError.bind(this)} /> { item.description && <span className='image-gallery-description'> {item.description} </span> } </div> ) }
-