Closed livtanong closed 7 years ago
Seems like certain tags are getting mangled in advanced compilation when compiling down the generated React DOM fns. The React.DOM property access symbol generated in dom.cljc seems to be affected sometimes by the compilation. I'm not sure why.
Tried logging out all the tags while accessing the React.DOM property the same way (through macro-expansion of the symbol) and the dialog
, picture
, clipPath
, and var
tags were compiling down to mangled property React.DOM property names.
We could just ensure string property access to prevent compiler mangling. The following change to dom.cljc fixes the issue for me.
(defn ^:private gen-react-dom-fn [tag]
`(defn ~tag [opts# & children#]
(.apply (aget ~(symbol "js" "React.DOM") ~(name tag)) nil
(cljs.core/into-array
(cons opts# (cljs.core/map om.util/force-children children#))))))
Just tested this out. Works perfectly for me! Thanks, @alvinfrancis :D
Sorry but this is not an issue. You need to provide externs for SVG, that's it
@anmonteiro I've tried using externs, but I can't seem to get the externs to work. In my build.boot, my cljs task:
(cljs :optimizations :advanced
:compiler-options {:externs ["svg.ext.js"]})
I've placed svg.ext.js
in the classpath (the one you sent me, from https://github.com/Hunga1/svg-externs and renamed it from svg.js
to svg.ext.js
.
Am I missing something?
This turned out to be an issue with CLJSJS's packages. I submitted a PR (https://github.com/cljsjs/packages/pull/814) which should fix it. While the PR isn't merged you can add the externs manually on a per project basis.
Feel free to reopen if the issue persists even after the fix.
Stack trace: