reagent

A minimalistic ClojureScript interface to React.js http://reagent-project.github.io/
rcecchino 2020-10-18T12:48:49.070600Z

Wondering why on-load for SVG isn't firing:

[:svg {:height "100"
       :width  "100"
       :on-load #(js/alert "SVG loaded.")}
       [:circle {:cx "50" :cy "50" :r "40" :stroke "black" :stroke-width "3" :fill "red"}]]

rcecchino 2020-10-18T12:49:24.071100Z

Similar HTML does work:

<html>
 <body>
  <svg height="100" width="100" onload="javascript: alert('SVG loaded.');">
   <circle cx="50" cy="50" r="40" stroke="black" stroke-width="3" fill="red" />
  </svg>
 <body>
<html>

rcecchino 2020-10-18T12:49:46.071300Z

Any ideas?

victorb 2020-10-18T12:54:27.071900Z

@rcecchino don't think React supports using onLoad. You better off grabbing a reference via ref and then setting the listener manually

rcecchino 2020-10-18T12:57:08.073500Z

Thanks @victorbjelkholm429. Assembled a quick React app and it is in fact not working there. Will go the ref route. Thanks!

🙏 1