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

Type issues with `CameraOptions` / initial props

Open joeyfigaro opened this issue 2 years ago • 2 comments

Looks like CameraOptions isn't using the types provided by react-native-camera, which is causing the compiler to complain when passing initial props to useCamera. You should be able to use the types provided by react-native-camera to build the hook's options/params.

https://joeysharesthings.com/EPh8G3

joeyfigaro avatar Aug 22 '21 16:08 joeyfigaro

I had the same issue and even found out that some type definitions on some functions returned from the hooks are just wrong ({cameraRef} parameter is missing in the types and this hook could be made so that the functions wouldn't even need this parameter).

I just used the methods in RNCamera and stopped using this lib. It is unmaintained and possibly could be a future security liability in the users' code because they aren't even updating their dependencies (look at their open PRs, it's full of PRs from dependabot trying to automatically update dependencies and they don't even merge those).

My piece of advice: don't use this library. My experience with using the methods from RNCamera was perfectly fine! I created my own hook in 10 minutes and it worked perfectly.

TheDSCPL avatar Oct 01 '21 17:10 TheDSCPL

This is my hook. Bear in mind that this is just an example of my use case. I didn't export as many functions as this lib does because I only created the ones I needed for my app, but you can easily understand how you could do your own functions for the missing functionalities in my gist.

TheDSCPL avatar Oct 01 '21 17:10 TheDSCPL