react-native-camera-kit icon indicating copy to clipboard operation
react-native-camera-kit copied to clipboard

Warning: forwardRef render functions do not support propTypes or defaultProps. Did you accidentally pass a React component?

Open ajstokar opened this issue 3 years ago • 5 comments

Issue Description

I get the warning when using the Camera in Barcode Scan mode. Everything works, but I'm wondering if this is a serious warning or not. Here is the return value of my component.

<CameraScreen
            actions={{rightButtonText: 'Done', leftButtonText: 'Cancel'}}
            onBottomButtonPressed={(event) => onCancel()}
            // flashImages={{
            //     // optional, images for flash state
            //     on: require('path/to/image'),
            //     off: require('path/to/image'),
            //     auto: require('path/to/image'),
            // }}
            // cameraFlipImage={require('path/to/image')} // optional, image for flipping camera button
            // captureButtonImage={require('path/to/image')} // optional, image capture button
            // torchOnImage={require('path/to/image')} // optional, image for toggling on flash light
            // torchOffImage={require('path/to/image')} // optional, image for toggling off flash light
            // hideControls={false} // (default false) optional, hides camera controls
            // showCapturedImageCount={false} // (default false) optional, show count for photos taken during that capture session
            // Barcode props
            scanBarcode={true}
            onReadCode={(event) => {
                    console.log('Reading: ' + event.nativeEvent.codeStringValue);
                }
            } // optional
            showFrame={true} // (default false) optional, show frame with transparent layer (qr code or barcode will be read on this area ONLY), start animation for scanner,that stoped when find any code. Frame always at center of the screen
            laserColor="red" // (default red) optional, color of laser in scanner frame
            frameColor="white" // (default white) optional, color of border of scanner frame
        />

Environment

  • React Native Navigation version: 5.8.10
  • React Native version: 0.63.3
  • Platform(s) (iOS, Android, or both?): iOS
  • Device info (Simulator/Device? OS version? Debug/Release?): Simulator & Device in Debug

ajstokar avatar Apr 03 '21 12:04 ajstokar

I think this happens because of these lines

https://github.com/teslamotors/react-native-camera-kit/blob/3208896c569b2ab79db1e292129de47de5d2af99/src/Camera.ios.tsx#L29-L33

renanmav avatar Apr 19 '21 20:04 renanmav

I commented this line out it stopped the error

kshahzada avatar May 03 '21 01:05 kshahzada

Awesome! Any idea when the next release will be published?

On Sun, May 2, 2021 at 9:39 PM Kaspar Shahzada @.***> wrote:

I commented this line out it stopped the error

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/teslamotors/react-native-camera-kit/issues/391#issuecomment-830982454, or unsubscribe https://github.com/notifications/unsubscribe-auth/AANXP6SPWCECTIJSOU7MTG3TLX5EBANCNFSM42KGHB3A .

ajstokar avatar May 04 '21 14:05 ajstokar

Lol - I'm not a maintainer, and I'm sure there is a good reason why it's made this way. If you want a temporary fix to shut up ESLint, go to node_modules/react-native-camera-kit/src/Camera.ios.tsx and comment out lines 29-33 as @renanmav suggested.

I might try and fork and understand what's going on this weekend and maybe they'll release it next week. Idk. New to this project too :)

kshahzada avatar May 04 '21 14:05 kshahzada

Hey Guys - I made a PR to fix this #396. Feel free to pull and test/use it; even better would be to review the pull so it makes it easier for a maintainer to merge.

Cheers :)

kshahzada avatar May 04 '21 17:05 kshahzada