Skip to content

Instantly share code, notes, and snippets.

@NilsonLima
Created May 7, 2021 13:37
Show Gist options
  • Save NilsonLima/f0543df78856db20dbe4c759ba58abc5 to your computer and use it in GitHub Desktop.
Save NilsonLima/f0543df78856db20dbe4c759ba58abc5 to your computer and use it in GitHub Desktop.
CameraTester
/* CameraTester.js */
import { RNCamera } from 'react-native-camera';
function CameraTester({ type }) {
const handleDetectedFaces = ({ faces }) => {
return /* test succeeded */;
};
const handleDetectionError = error => {
log(error);
return /* abort test */;
};
return (
<RNCamera
style={{ flex: 1 }}
type={type}
faceDetectionMode={RNCamera.Constants.FaceDetection.Mode.fast}
onFacesDetected={handleDetectedFaces}
onFaceDetectionError={handleDetectionError}
/>
);
}
CameraTester.type = RNCamera.Constants.Type;
export default CameraTester;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment