Add lazy loading of images. Fixes #329 (#379)

This commit is contained in:
Dessalines 2021-08-23 16:16:05 -04:00 committed by GitHub
parent 08aa1bb511
commit 6a3bdaa85c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -27,6 +27,7 @@ export class PictrsImage extends Component<PictrsImageProps, any> {
<img <img
src={this.src("jpg")} src={this.src("jpg")}
alt={this.alt()} alt={this.alt()}
loading="lazy"
className={` className={`
${!this.props.icon && !this.props.iconOverlay && "img-fluid "} ${!this.props.icon && !this.props.iconOverlay && "img-fluid "}
${ ${