Update barcode read event listener when `onBarCodeRead` prop updates
This commit is contained in:
parent
860d3bfe19
commit
a4dbc5e007
2
index.js
2
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)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue