Fork me on GitHub
#cljsrn
<
2017-09-14
>
rovanion08:09:22

How do you reference this when inside a react component? Say that:

(defn create-element [rn-comp opts & children]
      (apply js/React.createElement rn-comp (clj->js opts) children))

(defonce map-view     (partial create-element (js/require "react-native-maps")))

(map-view {:onRegionChange #(set! this.something %)})

pesterhazy12:09:18

Do you mean inside a reagent component?

pesterhazy12:09:58

[:> map-view props]

pesterhazy12:09:14

I don't think this will work on a pure functional component though

rovanion13:09:12

Yeah, inside a reagent/rum componant.

petterik23:09:27

@seantempesta The expo forum post is here and got a response suggesting trying babel-plugin-transform-nothing: https://forums.expo.io/t/improving-exp-publish-times-for-clojurescript/3096

raspasov23:09:26

“You wouldn’t believe what the latest React Native upgrade made him do” https://github.com/drapanjanas/re-natal/issues/127

raspasov23:09:30

@pesterhazy thank you for all the suggestions in that issue btw, it was helpful on the way to solving it for me (for the time being)