This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-08-11
Channels
- # aleph (7)
- # announcements (5)
- # beginners (58)
- # calva (20)
- # cider (10)
- # clj-kondo (4)
- # cljfx (5)
- # cljsrn (7)
- # clojure (29)
- # clojure-europe (11)
- # clojure-mexico (1)
- # clojure-norway (26)
- # clojure-uk (9)
- # clojurescript (1)
- # cursive (31)
- # datahike (22)
- # datomic (12)
- # duct (3)
- # fulcro (28)
- # helix (35)
- # hyperfiddle (28)
- # lsp (4)
- # malli (8)
- # midje (3)
- # music (2)
- # nbb (9)
- # nrepl (20)
- # off-topic (36)
- # polylith (3)
- # shadow-cljs (47)
- # sql (2)
- # testing (7)
- # vim (17)
- # xtdb (7)
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]])
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.