This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-03-04
Channels
- # boot (41)
- # cljs-dev (1)
- # cljsrn (64)
- # clojure (63)
- # clojure-argentina (2)
- # clojure-austin (1)
- # clojure-russia (1)
- # clojure-spec (1)
- # clojure-uk (59)
- # clojurebridge (1)
- # clojurescript (45)
- # cursive (3)
- # datascript (7)
- # dirac (34)
- # emacs (15)
- # hoplon (1)
- # jobs-discuss (1)
- # jobs-rus (5)
- # klipse (180)
- # lumo (3)
- # om-next (1)
- # re-frame (7)
- # reagent (6)
- # ring (20)
- # specter (10)
- # testing (2)
- # uncomplicate (15)
- # untangled (39)
(set! js/window.FBSDK (js/require "react-native-fbsdk"))
(def ^js/window.FBSDK FBSDK js/window.FBSDK)
(def AccessToken (.-AccessToken FBSDK))
(-> AccessToken
(.getCurrentAccessToken)
(.then
;on success
(fn [^js/Object success]
(let [^js/Object access-token-obj (.. success -accessToken)
fb-token (.toString access-token-obj)]
(println "fb-token ::: " fb-token)))
;on error
(fn [error])))
@rohit_ yes that always takes a while the first few times 🙂 (interop) - it does get easier though
why access it through js/window what magic is this :)
i'll try it and go figure this out too thanks @raspasov
what's the best resource to understand some of this interop
and I think they are somehow the same thing 🙂 (I know nothing about JavaScript - j/k, kinda :D)
@rohit_ this has been helpful to me sometimes https://kanaka.github.io/clojurescript/web/synonym.html
i see all of the react-native examples so far seem to do the adapt-react-class and then access methods and properties on the object after i havent seen any places that access methods through like the global js/<object> and im having a hard time telling the difference
unless the best way is to just go read the source
the re-natal template generates sample react native components that way
for React Native in many cases the best way to understand things is to read the source (which is actually very nicely structured and well commented in many cases)
all the standard react components work that way but then there are 3rd party components not in the react library that are somehow different
wrong/outdated, like the prop used to be called this, but now it’s something else - it’s getting less and less but I’ve run into things around ScrollView
this sdk being one of them
the firebase api is similarly a little different too
i should go check the reagent source to see what it really is
i'll try what you gave me
i just started so i can use the help
but mostly stuckmyself into reframe and whatever renatal does by default
can’t help you with Reagent though 🙂 happy to help with pure React Native stuff or om.next/react native related
one thing I do like about om.next is the fact that all om-next components are effectively “pure” JavaScript react components
probably i'll ask again if i cant get this to run
yes ive worked with clojure mostly before
all of this is new to me
none other than toy example
i hope it is
when things work its awesome when they dont i have trouble figuring out why google wont help me :(
yes and that would be to go understand interop
i keep getting stuck there given i dont understand javacript well enough either
jsx is a mystery
it’s the React Native + cljs that’s mostly the uncharted path 🙂 but in the end, if you get a very good understanding of ClojureScript, it’s basically a 1:1 translation of js examples -> cljs
so all examples typed out in that form take time to translate
(set! js/window.React (js/require "react"))
(set! js/window.ReactNative (js/require "react-native"))
(def ReactNative js/window.ReactNative)
(defn create-element [rn-component opts & children]
(apply js/React.createElement rn-component (clj->js opts) children))
(def text (partial create-element (.-Text ReactNative)))
(text
{:style {:color "white" :letterSpacing 0.5 :fontWeight "200"}}
"ClojureScript rocks!”)
a full example of how to require React, React Native, create a helper create-element function, define one of the React Native built-in components (Text) and then actually render the text (has to be inside a render method, of course)
thanks for the time
Hi guys! I'm pretty new to Clojure and Clojurescript, hoping to perform a switch from JS. Now it's time for me to try it out on a real project, so I've decided to take a shot with React Native and Re-Natal seems to be the best choice out there. Please cheer me up! 🙂 The Re-Natal channel is not so active as this one, so I guess I'll ask the question here, maybe someone can help... So here's the question. Re-Natal uses the 23 target android version by default, how to properly change it?
hey hey, anyone Berlin based ? giving a talk at the next clojure meetup about re-natal / reagent / re-frame / clojurescript