Fork me on GitHub
#reagent
<
2015-11-12
>
nooga18:11:12

I get Error: No protocol method IAssociative.-assoc defined for type reagent.ratom/RAtom: [object Object] while doing (swap! app-state update-in [:index :users] clojure.set/union (->> d :users keys (into #{})))

nooga18:11:53

I have no idea what’s wrong 😞

nooga18:11:30

ah, ok, I’m stupid, never mind :F

grav21:11:11

How do I get the dom-node of a reagent component in render?

grav21:11:37

Or rather, the dom-node of a div inside a reagent component

grav21:11:33

Seems I have to do something like this:

(defn my-component []
  (reagent/create-class 
    :render
          (fn [this]
              (let [[node (reagent/dom-node this)
                    [_ x y z] (reagent/argv this)] 
...
according to https://github.com/reagent-project/reagent/issues/47#issuecomment-61056999

grav21:11:53

That’s suddenly pretty verbose 😕

mikethompson22:11:56

What's the broader goal? (What does getting to the dom-node allow you to do)?

mikethompson22:11:38

Okay, i gotta go, but I'm guessing this might be helpful to you, even though it isn't a direct answer to your question: http://nils-blum-oeste.net/clojurescripts-reagent-using-props-in-lifecycle-hooks/