This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-09-16
Channels
- # announcements (19)
- # babashka (13)
- # beginners (7)
- # calva (8)
- # cider (25)
- # clj-kondo (12)
- # cljsrn (7)
- # clojure (60)
- # clojure-australia (5)
- # clojure-europe (59)
- # clojure-france (14)
- # clojure-gamedev (2)
- # clojure-nl (1)
- # clojure-uk (7)
- # clojurescript (43)
- # community-development (8)
- # core-async (2)
- # cursive (15)
- # datomic (75)
- # deps-new (31)
- # depstar (1)
- # fulcro (6)
- # graalvm (53)
- # holy-lambda (1)
- # juxt (3)
- # jvm (13)
- # kaocha (8)
- # lsp (109)
- # malli (14)
- # off-topic (62)
- # pathom (11)
- # pedestal (12)
- # polylith (12)
- # releases (5)
- # sci (5)
- # shadow-cljs (15)
- # sql (16)
- # tools-deps (27)
- # vim (1)
- # xtdb (14)
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...
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"))))
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
shadow-cljs has no support for moving them there for you but you don't need to put them into the output dir
your js/require path just needs to be relative to that to (js/require "../assets/some.svg")
would work
I use this page to convert the SVG to RN code: https://react-svgr.com/playground/