How to connect to focus using an adaptive camera

I would like to give the user the opportunity to take a picture. But I do not know how this works.

I found in the documentation a section related to the problem: react-native-camera But is there any example to see how it works? I do not know how to implement this.

In addition, the default parameter did not work. I did not have visual feedback when I clicked on the camera screen and it did not seem to focus.

Can someone help me on this?

Update: Solution

It seems that the error has been fixed for a long time, but at the moment the dependency is not updated, so the function does not work. As a workaround before the new version > 0.38.0 , add this link https://github.com/lwansbrough/react-native-camera.git#8f37727be69132cdbfed95255c8bd010a1db5c7d (with the last commit hash to master) to your package.json .

After that add to the <camera /> defaultOnFocusComponent={ true } onFocusChanged={ this.state.handleFocusChanged } and handleFocusChanged: () => {}, as the initial state

+5
source share

Source: https://habr.com/ru/post/1241557/


All Articles