Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-barcode

Package Overview
Dependencies
Maintainers
1
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-barcode - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

12

lib/react-barcode.js

@@ -25,2 +25,3 @@ 'use strict';

value: React.PropTypes.string.isRequired,
renderer: React.PropTypes.string,
format: React.PropTypes.string,

@@ -48,2 +49,3 @@ width: React.PropTypes.number,

format: 'CODE128',
renderer: 'svg',
width: 2,

@@ -81,8 +83,12 @@ height: 100,

update: function update() {
var canvas = getDOMNode(this.refs.canvas);
new JsBarcode(canvas, this.props.value, this.props);
var renderElement = getDOMNode(this.refs.renderElement);
new JsBarcode(renderElement, this.props.value, this.props);
},
render: function render() {
return React.createElement('canvas', { ref: 'canvas' });
if (this.props.renderer === "svg") {
return React.createElement('svg', { ref: 'renderElement' });
} else if (this.props.renderer === "canvas") {
return React.createElement('canvas', { ref: 'renderElement' });
}
}

@@ -89,0 +95,0 @@ });

{
"name": "react-barcode",
"version": "1.0.1",
"version": "1.0.2",
"description": "React component to generate barcodes",

@@ -5,0 +5,0 @@ "keywords": [

# react-barcode
<img src="https://raw.githubusercontent.com/kciter/react-barcode/master/images/barcode.png" alt="barcode">
<img src="https://raw.githubusercontent.com/kciter/react-barcode/master/images/barcode.png" alt="barcode" width="600"><br>
Preview: http://kciter.github.io/react-barcode/
A `<Barcode/>` component for use with React.<br>
This library is wrapped by [JsBarcode](https://github.com/lindell/JsBarcode)
This library wrapped [JsBarcode](https://github.com/lindell/JsBarcode).

@@ -16,5 +16,6 @@ ## Installation

var React = require('react');
var ReactDOM = require('react-dom');
var Barcode = require('react-barcode');
React.render(
ReactDOM.render(
<Barcode value="http://github.com/kciter" />,

@@ -21,0 +22,0 @@ mountNode

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