Fork me on GitHub
#cljsrn
<
2017-05-17
>
pesterhazy06:05:16

@thheller yes, haul is a very interesting new development!

gphilipp12:05:20

For those using reagent or re-frame, what are the benefits/drawbacks of using the [:> View...] syntax where View is a direct js require, versus [view ...] where view is a reagent adapter as in (def view (r/adapt-react-class (.-View ReactNative))) ?

seantempesta12:05:34

@gphilipp: I’ve been doing that in case I need greater control when interacting with components. Also, I like how I can tell at a glance if the component I’m working with is a normal react component or a reagent one. A potential downside could be the extra time interpreting the symbol, but I can’t imagine it’s too costly?

seantempesta12:05:37

Hey guys. @tiensonqin asked me to take over managing his exponent libraries since he doesn’t have the time to manage them anymore. So hit me up if you have questions, suggestions or concerns. And let’s all take a moment to thank @tiensonqin on his excellent library! 🙂

gphilipp14:05:28

@seantempesta That’s nice. I’ve done a repo myself where I store every tip I stumbled upon since joining this channel including some quotes from you guys. It might be useful both for newcomers and advanced users as well: https://github.com/gphilipp/react-native-with-clojurescript

gphilipp14:05:07

@seantempesta do you know how to customize the header from the screen ? Basically, replicate this example from the react-navigation doc: https://reactnavigation.org/docs/intro/headers

seantempesta16:05:20

@gphilipp: So, you’ve got two options. You can statically assign navigationOptions or you can use a function and dynamically return the navigationOptions. Here are some examples from the login screen in my re-frame example:

(def static-navigationOptions {:headerTitle "Login"
                               :headerRight (fn []
                                              [:> Button {:title   "Sign In"
                                                          :onPress #(dispatch [:login])}])})

(defn dynamic-navigationOptions [{:keys [navigation] :as props}]
  (let [navigate (:navigate navigation)]
    {:headerTitle "Login"
     :headerRight (fn []
                    [:> Button {:title   "Sign In"
                                :onPress #(navigate "Loading")}])}))

gphilipp16:05:21

ah yeah, perfect thx

seantempesta16:05:48

np. I’ll update my example to include both for future reference.

seantempesta16:05:44

@gphilipp : You’ve been quite dilligent about collecting cljsrn info! I remember quite a few of those conversations. 🙂

seantempesta16:05:50

Keep up the good work.