Socket
Socket
Sign inDemoInstall

react-native-qrcode-svg

Package Overview
Dependencies
Maintainers
1
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-qrcode-svg - npm Package Compare versions

Comparing version 1.0.3 to 1.0.4

screenshot.png

20

index.js

@@ -8,7 +8,14 @@ // core

/**
* A simple component for displaying QR Code using svg
*/
export default class QRCode extends Component {
static propTypes = {
/* what the qr code stands for */
value: PropTypes.string,
/* the whole component size */
size: PropTypes.number,
/* the color of the cell */
color: PropTypes.string,
/* the color of the background */
backgroundColor: PropTypes.string,

@@ -24,4 +31,5 @@ };

super(props);
this._matrix = null;
this._cellSize = null;
this._matrix = null;
this._path = null;
this.setMatrix(props);

@@ -33,4 +41,8 @@ }

componentWillUpdate(nextProps) {
this.setMatrix(nextProps);
// if value has changed, re-setMatrix
if (nextProps.value !== this.props.value) {
this.setMatrix(nextProps);
}
}
/* calculate the size of the cell and draw the path */
setMatrix(props) {

@@ -41,3 +53,5 @@ const { value, size } = props;

this._cellSize = size / (this._matrix.length + 2);
this._path = this.transformMatrixIntoPath();
}
/* project the matrix into path draw */
transformMatrixIntoPath() {

@@ -84,3 +98,3 @@ const matrix = this._matrix;

<Path
d={this.transformMatrixIntoPath()}
d={this._path}
stroke={color}

@@ -87,0 +101,0 @@ strokeWidth={this._cellSize}

2

package.json
{
"name": "react-native-qrcode-svg",
"version": "1.0.3",
"version": "1.0.4",
"description": "A QR Code generator for React Native based on react-native-svg and javascript-qrcode.",

@@ -5,0 +5,0 @@ "main": "index.js",

# react-native-qrcode-svg
A QR Code generator for React Native based on react-native-svg and javascript-qrcode.
![screenshot](./screenshot.png)
Please install react-native-svg first.

@@ -4,0 +7,0 @@ ```

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