cljsrn

gammarray 2021-09-16T16:27:18.240800Z

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...

gammarray 2021-09-16T17:02:28.241200Z

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"))))

gammarray 2021-09-16T17:13:57.241400Z

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

thheller 2021-09-16T17:20:43.241600Z

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

thheller 2021-09-16T17:21:01.241800Z

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

thomas 2021-09-17T08:48:10.242100Z

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

thomas 2021-09-17T08:48:28.242400Z

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