Fork me on GitHub
#cljsrn
<
2023-07-18
>
Kent Bull23:07:53

How would I add an SVG to my React Native app? I’m using http://html2hiccup.buttercloud.com to convert my HTML to Hiccup and then trying to add that to my page like so:

(defn add-icon []
    [:svg {:xmlns "", :width "40", :height "40", :fill "#000", :viewbox "0 0 40 40"}
     [:path {:stroke "#000", :stroke-linecap "round", :stroke-width "3", :d "M20.5 1.5v37M1.5 19.5h37"}]])
Then when I use this in my page as (svg/add-icon) I get the following error:
Invariant Violation: View config getter callback for component `path` must be a function (received `undefined`). Make sure to start component names with a capital letter.
Am I not creating the react component properly?