How to use the react-native-camera-hooks.useCamera function in react-native-camera-hooks

To help you get started, we’ve selected a few react-native-camera-hooks examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github reime005 / react-native-camera-hooks / example / ExpoExample / App.tsx View on Github external
export default function App() {
  const [hasCameraPermission, setHasCameraPermission] = useState(null);

  const [{ cameraRef, type }, { toggleFacing, recordVideo }] = useCamera();

  useEffect(() => {
    const checkPerm = async () => {
      const { status } = await Permissions.askAsync(Permissions.CAMERA);
      setHasCameraPermission(status === 'granted');
    };

    checkPerm();
  }, [setHasCameraPermission]);

  if (hasCameraPermission === null) {
    return

react-native-camera-hooks

React Native Hooks for the react-native-camera module.

MIT
Latest version published 3 years ago

Package Health Score

45 / 100
Full package analysis

Popular react-native-camera-hooks functions