This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-04-11
Channels
- # aleph (1)
- # architecture (18)
- # beginners (57)
- # boot (13)
- # cider (47)
- # cljs-dev (28)
- # cljsjs (13)
- # cljsrn (39)
- # clojure (258)
- # clojure-greece (16)
- # clojure-italy (2)
- # clojure-miami (1)
- # clojure-nl (9)
- # clojure-poland (15)
- # clojure-russia (369)
- # clojure-spec (53)
- # clojure-uk (49)
- # clojureremote (3)
- # clojurescript (135)
- # core-matrix (1)
- # cursive (11)
- # datascript (3)
- # datomic (4)
- # emacs (12)
- # figwheel (13)
- # hoplon (7)
- # interop (7)
- # jobs-discuss (33)
- # lumo (28)
- # off-topic (15)
- # om (7)
- # onyx (26)
- # pedestal (10)
- # perun (1)
- # planck (10)
- # re-frame (54)
- # reagent (16)
- # ring (5)
- # ring-swagger (50)
- # rum (2)
- # spacemacs (2)
- # unrepl (125)
- # untangled (12)
Hello! Any advice on how to access the device's accelerometer (Android) with re-natal? I'm tyring to use this https://github.com/kprimice/react-native-sensor-manager which I think is a 'NativeModule' but I can't find any documuntation on NativeModules, and following the procedure for components hasn't worked for me so far.
As per the instructions in that repo i try to require 'NativeModules' but it can't be found
Hey @misha thanks for the response
okay thanks i'll look into it
phew okay thanks, looks like i'm in for more than i bargained for
so just curious that repo i posted, is it incomplete? do you always need a js wrapper?
usually, repos have both android and ios wrappers included. so you just npm install ...
and js/require(...)
them.
I've tried (def NativeModules (js/require "NativeModules"))
thanks again
@leonmanrolls did you follow lib installation steps from that repo?
yes, well i did react-native link
and when i run 'react-native run-android' the classes show up
this is an import of (ios) lib I wrote myself:
(def ReactNative (js/require "react-native"))
(def ^:private NativeModules (.-NativeModules ReactNative))
(def ^:private DSS (.-DSS NativeModules))
ah that looks promising i'll try that
Great so this worked! (def SensorManager (.-SensorManager (.-NativeModules ReactNative)))
Do you think it's worth adding this to the re-natal docs?
@misha How this works "react-native.-NativeModules.-SensorManager"
? :thinking_face:
Hey guys -- I have a project set up using re-natal, but I'm having trouble getting a test suite working. The included test stub isn't even clojurescript. How have you approached getting unit tests running?
personally I've concluded that integration testing isn't worth it for small teams when using react native
because it's hard to make reliable
not even trying to do integration tests... I just have a few very sensitive functions I want to make sure I unit test
for that you should be able to use regular clojurescript testing tools
But it's unclear how to get the thing running. I have a figwheel repl, but I don't think the /test directory is even in the environment
I'm afraid of manually changing a bunch of the project.clj settings, because I think they're auto-generated somehow by re-natal
hm I don't know about that because I use boot-react-native
but some others in this channel may be able to help