Fork me on GitHub
#cljsrn
<
2021-09-16
>
gammarray16:09:18

could have sworn i saw discussion of svg usage here recently. anyhow i'm trying to use react-native-svg with svg files in a shadow-cljs project. maybe i should be using SvgXml for inline code instead? curious how to best to approach svg in cljsrn...

gammarray17:09:28

seems like this works alright if i've added the asset to my outputdir: (def logo (r/adapt-react-class (.-default (js/require "./logo.svg"))))

gammarray17:09:57

i think i read somewhere that it's easier to just leave the assets in the output-dir and add an exception to .gitignore than having shadow-cljs move it in there

thheller17:09:43

shadow-cljs has no support for moving them there for you but you don't need to put them into the output dir

thheller17:09:01

your js/require path just needs to be relative to that to (js/require "../assets/some.svg") would work

thomas08:09:10

I use this page to convert the SVG to RN code: https://react-svgr.com/playground/

thomas08:09:28

but only works for simple SVG's ie. icons etc.