The react native expo camera example gives errors like _Camera is not defined https://docs.expo.io/versions/latest/sdk/camera.html but I see others have gotten it to work here
Does anyone have some basic code on how to make use of the camera module? Or debug why the documentation example isn't working?
For this, we will use a Simple library called expo-camera . This supports various camera functionalities like zoom, auto focus, white balance and flash mode, etc. So let's get started, first you have to need to set up the mobile application using expo-cli. For this, you can follow Setup react native app using expo.
It helps you from the creation to distribution of your React Native apps. Remember, when you are coding in Expo, you still write React Native code. But with the support of the Expo CLI and Expo Client on your smartphone. It is better to use Expo CLI if you are new to app development.
I got same issue, after a lot of research Expo Camera is added from v20.I was using v19.0. I am new to Expo and did not realize it was added in v20 here. Problem is solved after upgrading react-native expo version to v20. .basic code for camera in expo is here
edit in package.json
"react-native": "https://github.com/expo/react-native/archive/sdk-20.0.0.tar.gz",
"expo": "20.0.0-alpha.4",
"react": "16.0.0-alpha.12",
edit in app.json
"sdkVersion": "20.0.0",
Delete your project’s node_modules directory and run npm install
Reopen your project in XDE and press “Restart” to clear the packager cache
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With