diff --git a/lib/index.js b/lib/index.js index 08df3e1..7d0c0e9 100644 --- a/lib/index.js +++ b/lib/index.js @@ -275,7 +275,7 @@ module.exports = (_temp = _class = function (_Component) { var decoded = e.data; - onScan(decoded || null); + onScan(decoded.data || null); if (!legacyMode && typeof delay == 'number' && this.worker) { this.timeout = setTimeout(this.check, delay); diff --git a/package.json b/package.json index 55d0732..193d446 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-qr-scanner", - "version": "0.0.3", + "version": "0.0.4", "description": "A react component for reading QR codes from the webcam.", "main": "./lib/index.js", "scripts": { @@ -39,11 +39,8 @@ "gulp-concat": "^2.6.1", "gulp-inline-str": "^0.1.0", "gulp-uglify": "^2.0.0", - "react": "^15.0.2" - }, - "peerDependencies": { - "react": "^15.0.2", - "react-dom": "^15.0.2" + "react": "15.6.2", + "react-dom": "15.6.2" }, "dependencies": { "jsqr": "^1.0.1", diff --git a/src/index.js b/src/index.js index a5a819a..1fb367f 100644 --- a/src/index.js +++ b/src/index.js @@ -220,7 +220,7 @@ module.exports = class Reader extends Component { const { onScan, legacyMode, delay } = this.props const decoded = e.data - onScan(decoded || null) + onScan(decoded.data || null) if (!legacyMode && typeof delay == 'number' && this.worker) { this.timeout = setTimeout(this.check, delay)