Fork me on GitHub

@richiardiandrea: as I understand it, you’d have to invent your own method. It’s explained a bit here:,


So the child has to be a component itself, and it can then call its parent with itself, when it’s mounted.


It’s a bit of a hassle, but then again, it allows for some optimizations as the author explains, and it’s usually not necessary to have a whole lot of refs.


I have only used refs when wrapping other libraries such as Open Layers. In that case I just had a single <div ref=‘map'> in my render anyways, so I could just use (r/dom-node this) instead.


In another case, we had a login component which read the values of username and password input fields directly from the DOM (which I consider a bit of an anti-pattern in React). I replaced that with callback functions that just updated the component state.