Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type issues with CameraOptions / initial props #53

Open
joeyfigaro opened this issue Aug 22, 2021 · 2 comments
Open

Type issues with CameraOptions / initial props #53

joeyfigaro opened this issue Aug 22, 2021 · 2 comments

Comments

@joeyfigaro
Copy link

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

@TheDSCPL
Copy link

TheDSCPL commented Oct 1, 2021

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
Copy link

TheDSCPL commented Oct 1, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants