react-barcode
Advanced tools
Comparing version 1.4.1 to 1.4.2
@@ -55,2 +55,3 @@ "use strict"; | ||
_this = _possibleConstructorReturn(this, _getPrototypeOf(Barcode).call(this, props)); | ||
_this.renderElementRef = _react["default"].createRef(); | ||
_this.update = _this.update.bind(_assertThisInitialized(_this)); | ||
@@ -82,3 +83,3 @@ return _this; | ||
value: function update() { | ||
var renderElement = getDOMNode(this.refs.renderElement); | ||
var renderElement = getDOMNode(this.renderElementRef.current); | ||
@@ -97,11 +98,11 @@ try { | ||
return _react["default"].createElement("svg", { | ||
ref: "renderElement" | ||
ref: this.renderElementRef | ||
}); | ||
} else if (this.props.renderer === 'canvas') { | ||
return _react["default"].createElement("canvas", { | ||
ref: "renderElement" | ||
ref: this.renderElementRef | ||
}); | ||
} else if (this.props.renderer === 'img') { | ||
return _react["default"].createElement("img", { | ||
ref: "renderElement" | ||
ref: this.renderElementRef | ||
}); | ||
@@ -108,0 +109,0 @@ } |
{ | ||
"name": "react-barcode", | ||
"version": "1.4.1", | ||
"version": "1.4.2", | ||
"description": "React component to generate barcodes", | ||
@@ -12,2 +12,3 @@ "keywords": [ | ||
"main": "lib/react-barcode.js", | ||
"types": "src/react-barcode.d.ts", | ||
"scripts": { | ||
@@ -28,3 +29,3 @@ "lint": "eslint src/ samples/demo.js", | ||
"peerDependencies": { | ||
"react": "^16.0.0 || ^17.0.0" | ||
"react": "^16.0.0 || ^17.0.0 || 18.0.0" | ||
}, | ||
@@ -31,0 +32,0 @@ "dependencies": { |
@@ -25,2 +25,12 @@ # react-barcode | ||
Or | ||
```js | ||
import Barcode from 'react-barcode'; | ||
export const Example: FunctionComponent = () => { | ||
return <Barcode value="barcode-example" />; | ||
}; | ||
``` | ||
## Options: | ||
@@ -27,0 +37,0 @@ |
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
10655
5
158
83