$ cnpm install react-lazy-imager
The imager is used to replace tag, and it will lazy to load the picture.
Install
npm install -S react-imager
Then use it in your app:
import React from 'react';
import Img from 'react-imager';
class App extends React.Component {
successCallback(){
}
render() {
return (
<Img
src="./expamle.png"
thumbSrc="./thumb.png"
className="demo"/>
onSuccess={this.successCallback}
);
}
}
It has all the attributes of the <img> tag, such as:
MIT License
react image lazyload img
Copyright 2014 - 2017 © taobao.org |