Skip to content

Instantly share code, notes, and snippets.

@Aljullu
Created March 22, 2018 18:46
Show Gist options
  • Save Aljullu/608d4eba5491a2a716daad924e3f2f2f to your computer and use it in GitHub Desktop.
Save Aljullu/608d4eba5491a2a716daad924e3f2f2f to your computer and use it in GitHub Desktop.
MyImage.jsx (react-lazy-load-component example)
import React from 'react';
import { LazyLoadImage } from 'react-lazy-load-image-component';
const MyImage = ({ image }) => (
<div>
<LazyLoadImage
alt={image.alt}
height={image.height}
src={image.src}
width={image.width} />
<span>{image.caption}</span>
</div>
);
export default MyImage;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment