Fork me on GitHub

could someone please help me think about the following ReactJS example in a Reagent kind of way? the component seems to have an inherent handle on its children via this.refs. is this possible in Reagent? the only way i know how to get refs is to supply a {:ref fn} property to a child component in the render function. the goal is to store all bounding boxes of children components prior to render, and while i could use jquery i'd prefer to use the reagent way.


(by its children i mean its children's dom nodes)


@joshkh you can do ref callbacks just like in normal react by passing something like :ref #(reset! *ref %) to the component


^ in that example i set the ref to a local atom called *ref


oh i just looked at the example. i’m puzzled at that this.refs. is that some kind of react feature? I’ve never seen that before


I think there is something missing from that gist. he must have stored all the children refs on this after initial render