A minimalistic ClojureScript interface to React.js
Casey 2020-08-10T11:57:49.160200Z

Is there a straightforward way to get a reference to the dom element of a component inside an event handler? It's dirty I know... I have a component wrapping an <svg> and am implementing pan and zoom events on the svg. Mouse events performed on children of the svg (such as shapes in the image) have a value of the child, not the parent svg element. But I need a handle on the svg dom element to call getBoundingClientRect()




I’ve solved this and a have working solution. If someone interested -> PM

Casey 2020-08-10T14:06:27.162Z

@selfsame that assumes the target is a direct descendent of the svg, which it often isn't. I suppose I could just walk up the elements until landing on svg, but I figure there might be a cleaner way


ah then you'll have to walk the tree or use a :ref


ah right makes sense thanks