Update barcode read event listener when `onBarCodeRead` prop updates

This commit is contained in:
Derek Hsu 2017-01-23 15:02:27 +08:00
parent 860d3bfe19
commit a4dbc5e007
1 changed files with 1 additions and 1 deletions

View File

@ -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)
}
}