3 ms·
Can you elaborate on this a bit? I'm not that familiar with react itself, having only used it through om, but I built a proof of concept that let me work with
by lgas 11y ago
Can you elaborate on this a bit? I'm not that familiar with react itself, having only used it through om, but I built a proof of concept that let me work with SVGs via om with code like:
(defcomponent circle-view [data]
(render [_]
(let [size (get-in data [:circles :size])]
(html [:div.circle
[:svg {:height size
:width size}
[:circle {:cx (/ size 2)
:cy (/ size 2)
:fill "yellow"
:r (/ size 2)
:stroke "green"
:stroke-width 4}]]]))))
And it seemed to all work fine? (Using sablono obviously)
- dwwoelfel 11y agoOh sorry, I didn't mean to imply that none of the svg tags are present. Most of the common svg things work, but there are lots of missing tags and attributes. There's an issue for it here: https://github.com/facebook/react/pull/1032 https://github.com/facebook/react/pull/1032 Some of the things we had to add for Precursor were clipPath, foreginObject, mask, patternTransform, marker, and vector-effect.
- lgas 11y agoAh, ok, that makes sense. Thanks!