美文网首页
`Camera` has no propType for nat

`Camera` has no propType for nat

作者: zlzbt | 来源:发表于2021-05-19 17:06 被阅读0次

    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

    image

    在里面添加内容

    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

    相关文章

      网友评论

          本文标题:`Camera` has no propType for nat

          本文链接:https://www.haomeiwen.com/subject/qkmejltx.html