Demo: https://cdn.rawgit.com/DavisChang/react-progressive-media-loading/master/build/index.html
$ npm install react-progressive-media-loading --save
import ProgressiveImg from 'react-progressive-media-loading';
class Component extends React.Component {
render () {
const progressiveImgProps = {
smallImageSource: 'small.png',
normalImageSource: 'normal.png',
imgAlt: 'img-alt',
aspectRationFill: '50%',
};
return (
<div>
<h1>ProgressiveImg Component</h1>
<a target="_blank" href="#">
<ProgressiveImg
{ ...progressiveImgProps }
/>
</a>
</div>
);
};
};
.
├── /build/
├── /coverage/
├── /demo/
├── /lib/ # component css (index.css)
├── /src/
├── /test/
└── package.json
$ npm run dev
$ npm run test
$ npm run build
$ npm run webpack