This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-04-30
Channels
- # beginners (11)
- # boot (18)
- # cider (36)
- # cljs-dev (17)
- # cljsrn (5)
- # clojure (144)
- # clojure-android (4)
- # clojure-art (1)
- # clojure-brasil (1)
- # clojure-dev (5)
- # clojure-india (1)
- # clojure-russia (13)
- # clojure-spec (4)
- # clojurescript (15)
- # code-art (2)
- # cryogen (1)
- # defnpodcast (1)
- # hoplon (1)
- # leiningen (5)
- # off-topic (18)
- # om (4)
- # onyx (25)
- # parinfer (1)
- # pedestal (6)
- # portkey (1)
- # re-frame (16)
- # reagent (1)
- # uncomplicate (1)
- # unrepl (10)
- # yada (16)
@nxqd rum/ref is for "legacy API" String Refs. The above jsx code use newer API which allows to access refs via callback functions.
I don't want to pollute the component's "this" object like the js world's tradition
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
the same approach can be done by assigning to a Clojure atom
@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.