New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

viewerjs-react

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

viewerjs-react - npm Package Compare versions

Comparing version 0.0.2 to 1.0.0

2

dist/index.d.ts

@@ -11,4 +11,6 @@ import * as React from 'react';

private onRef;
componentDidUpdate(): void;
componentWillUnmount(): void;
render(): JSX.Element;
}
export {};

@@ -20,2 +20,3 @@ function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }

_this = _React$PureComponent.apply(this, arguments) || this;
_this.viewer = null;

@@ -31,3 +32,3 @@ _this.onRef = function (el) {

_this.viewer = new ViewerJS(el);
_this.viewer = new ViewerJS(el, _this.props.options);
};

@@ -40,2 +41,16 @@

_proto.componentDidUpdate = function componentDidUpdate() {
if (this.viewer) {
this.viewer.update();
}
};
_proto.componentWillUnmount = function componentWillUnmount() {
if (this.viewer) {
this.viewer.destroy();
}
this.viewer = null;
};
_proto.render = function render() {

@@ -42,0 +57,0 @@ return React.createElement("div", {

@@ -18,2 +18,3 @@ import { createElement, PureComponent } from 'react';

_this = _React$PureComponent.apply(this, arguments) || this;
_this.viewer = null;

@@ -29,3 +30,3 @@ _this.onRef = function (el) {

_this.viewer = new ViewerJS(el);
_this.viewer = new ViewerJS(el, _this.props.options);
};

@@ -38,2 +39,16 @@

_proto.componentDidUpdate = function componentDidUpdate() {
if (this.viewer) {
this.viewer.update();
}
};
_proto.componentWillUnmount = function componentWillUnmount() {
if (this.viewer) {
this.viewer.destroy();
}
this.viewer = null;
};
_proto.render = function render() {

@@ -40,0 +55,0 @@ return createElement("div", {

2

package.json
{
"name": "viewerjs-react",
"version": "0.0.2",
"version": "1.0.0",
"description": "React wrapper for viewerjs.",

@@ -5,0 +5,0 @@ "author": "tinymins",

@@ -18,3 +18,3 @@ # viewerjs-react

import MyComponent from 'viewerjs-react'
import RViewerJS from 'viewerjs-react'
import 'viewerjs-react/dist/index.css'

@@ -24,3 +24,5 @@

render() {
return <MyComponent />
return <RViewerJS>
<img src="xxx" />
</RViewerJS>
}

@@ -30,4 +32,10 @@ }

## Props
### options
Will passby to viewerjs. See [ViewerJS Options Document](https://github.com/fengyuanchen/viewerjs/blob/master/README.md#options).
## License
MIT © [tinymins](https://github.com/tinymins)

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc