Package Exports
- react-image-viewer-zoom
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (react-image-viewer-zoom) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
react-image-viewer-zoom
A scaleable image viewer written on React and Typescript.
Installation
$ npm install --save react-image-viewer-zoom
Usage
import ImageViewer from 'react-image-viewer-zoom'
import 'react-image-viewer-zoom/src/style.css' //for css
class MyComponent extends React.Component<any, any> {
render() {
const images: any = [
{ src: 'https://image', title: 'title', content: 'content' },
{ src: 'https://image', title: 'title', content: 'content' },
{ src: 'https://image', title: 'title', content: 'content' },
{ src: 'https://image', title: 'title', content: 'content' }
];
return (
<ImageViewer
showPreview={true}
showIndex={true}
prefixCls="mycomponent"
activeIndex={0}
images={images}/>
)
}
}
Typescript config
tsconfig.json
{
"compilerOptions": {
"allowSyntheticDefaultImports": true
}
}
Set
allowSyntheticDefaultImports
to preventerror TS1192: Module 'react' has no default export
.