From a4dbc5e00756b4806eea6fab16080537db730c02 Mon Sep 17 00:00:00 2001 From: Derek Hsu Date: Mon, 23 Jan 2017 15:02:27 +0800 Subject: [PATCH] Update barcode read event listener when `onBarCodeRead` prop updates --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index c797285..662e944 100644 --- a/index.js +++ b/index.js @@ -171,7 +171,7 @@ export default class Camera extends Component { componentWillReceiveProps(newProps) { const { onBarCodeRead } = this.props - if (onBarCodeRead && !newProps.onBarCodeRead) { + if (onBarCodeRead !== newProps.onBarCodeRead) { this._addOnBarCodeReadListener(newProps) } }