react-single-image-viewer
v1.0.1
Published
react image view component
Downloads
97
Readme
react-single-image-viewer
react image view component
Install
npm install --save react-single-image-viewer
Usage
import React, { Component } from 'react'
import ImageView from 'react-single-image-viewer'
import 'react-single-image-viewer/dist/index.css'
class Example extends Component {
render() {
return <ImageView src="xxxxx" height="100" width="200" callback="xxxx"/>
}
}
Params
| name | description | | :------: | :---------------------------: | | src | img path | | height | img height | | width | img width | | callback | when img load error show path |
Notice
Because of React hooks to run tests, you need to download react,react-dom yourself,or add them to devDependencies
License
MIT © FriendsA