JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 54
  • Score
    100M100P100Q52521F
  • License MIT

Scaleable image viewer written on Typescript and React.

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.

View the online demo.

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 prevent error TS1192: Module 'react' has no default export.