Fork me on GitHub
#reagent
<
2016-11-02
>
tianshu11:11:27

How can I get the current component in an event-handler(for example on-click function)?

tianshu11:11:44

I want to use reagent/force-update to update component immediately. Currently I'm using

(defonce forcer (atom 0))

(defn update-editor-state [new-editor-state]
  (re-frame/dispatch-sync [:content-edit/editor-state new-editor-state])
  (swap! forcer inc))
Wonder if there will be a better solution?

gamecubate18:11:40

Hi all. I use @reagent/track extensively to prevent undue renderings of components linked to my (deep) app db. Yet, a problem persists whereby stuff gets unnecessarily rendered and I wonder: is there a way to know what triggered a component render other than throwing sticks at my code by commenting sections in and out?