react-barcode
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -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 |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6297
81
68