Closed eddiefletchernz closed 8 years ago
+1
fixed it by replacing the last part of BarcodeScanner.js to
BarcodeScannerView.propTypes = {
viewFinderBackgroundColor: PropTypes.string,
viewFinderBorderColor: PropTypes.string,
viewFinderBorderWidth: PropTypes.number,
viewFinderBorderLength: PropTypes.number,
viewFinderDrawLaser: PropTypes.bool,
viewFinderLaserColor: PropTypes.string,
torchMode: PropTypes.string,
cameraType: PropTypes.string,
onBarCodeRead: PropTypes.func,
rotation: PropTypes.number,
scaleX: PropTypes.number,
scaleY: PropTypes.number,
translateX: PropTypes.number,
translateY: PropTypes.number,
importantForAccessibility: PropTypes.string,
accessibilityLabel: PropTypes.string,
testID: PropTypes.string,
renderToHardwareTextureAndroid: PropTypes.string,
onLayout: PropTypes.bool
};
var RNBarcodeScannerView = requireNativeComponent('RNBarcodeScannerView', BarcodeScannerView, {
nativeOnly: {
onChange: true,
accessibilityLiveRegion: 'none',
accessibilityComponentType: 'button'
}
});
@NorthFoxz Thank you so much! Also I can confirm that this bug is still present with the latest 0.16.0
Same error on react-native 0.17.0
@NorthFoxz Your code works, thanks. :+1:
I can confirm that @NorthFoxz solution fixes the issue on React Native 0.17 it would be great to get this fixed in master.
With @cpunions's merged pull request the issue should now be fixed.
I've just upgraded react-native to 0.16.0-rc and now the barcode scanner is throwing an error on require:
'BarcodeScannerView' has no propType for native prop 'RNBarcodeScannerView.renderToHardwareTextureAndroid' of native type 'boolean'.