any guide on accessing the camera?
You should be able to just use one of the normal RN libraries from CLJS relatively easily. Either in Expo, or with a lib like https://github.com/mrousavy/react-native-vision-camera
LOG Running "AwesomeProject" with {"rootTag":1}
ERROR TypeError: undefined is not an object (evaluating 'device.id')
here is the gist of the code
(defn cam []
(let [devices (rnvc/useCameraDevices)
device (. devices -back)]
[:> rnvc/Camera {:device device
:is-active true
:style (. rn/StyleSheet -absoluteFill)}]))
(defn root []
[:> rn/View {:style (.-container styles)}
[:> rn/Text {:style (.-title styles)} "Hello!"]
[:f> cam]])
using https://github.com/mrousavy/react-native-vision-camera
can anyone help me with that
i think i should await for the camera permission request, now trying to translate the js code
Yeah, from a quick look at the guide, you have to await Camera.requestCameraPermission(). I think if you just put your view behind an (if device ...) with a fallback loading/whatever screen, you’ll be fine.