Fork me on GitHub
#cljsrn
<
2017-04-30
>
myguidingstar05:04:54

@nxqd rum/ref is for "legacy API" String Refs. The above jsx code use newer API which allows to access refs via callback functions.

myguidingstar05:04:33

I don't want to pollute the component's "this" object like the js world's tradition

myguidingstar05:04:22

in the section "Refs and Functional Components" of React document for Refs, they recommend assigning the ref-ed object to a var outside from the callback

myguidingstar05:04:50

the same approach can be done by assigning to a Clojure atom

jimmy12:04:36

@myguidingstar . The issue has been mentioned here https://github.com/tonsky/rum/issues/124. I think there would be an api provided as a wrapper in rum. But for now, you are right, we can use the new api and get it done with atom in Clojure.