简体   繁体   中英

React Native Expo Camera

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?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM