`Camera` has no propType for native prop `RNCamera.detectedImageInEvent` of
小编在刚接触 react-native-camera 的时候,每一步都按照步骤来,终于android studio编译不报错了
启动react-native run-android结果走到调用camera的时候竟然又开始报错了,小编找了好久的方案终于知道解决办法了
!!! 竟然要改动node 引入的包里面的内容
去node_modules里面找到 RNCamera.js
在里面添加内容
const RNCamera = requireNativeComponent('RNCamera', Camera, {
nativeOnly: {
accessibilityComponentType: true,
accessibilityLabel: true,
accessibilityLiveRegion: true,
barCodeScannerEnabled: true,
touchDetectorEnabled: true,
googleVisionBarcodeDetectorEnabled: true,
faceDetectorEnabled: true,
textRecognizerEnabled: true,
importantForAccessibility: true,
onBarCodeRead: true,
onGoogleVisionBarcodesDetected: true,
onCameraReady: true,
onAudioInterrupted: true,
onAudioConnected: true,
onPictureSaved: true,
onFaceDetected: true,
onTouch: true,
onLayout: true,
onMountError: true,
onSubjectAreaChanged: true,
renderToHardwareTextureAndroid: true,
testID: true,
detectedImageInEvent: true, //这是我缺的 提示找不到什么就在这里面添加什么即可
cameraViewDimensions: true,
},
});
提示找不到什么就在这里面添加什么即可 ^.^
参考文档 https://github.com/react-native-camera/react-native-camera/issues/1161