Fork me on GitHub
Christopher Thonfeld-Guckes14:01:35

Hi there. I'm trying to use a reagent-material-ui component that wraps this one: Unfortunately I can't figure out, how to pass the icon prop. The example code uses this

<BottomNavigationAction label="Archive" icon={<ArchiveIcon />} />
I translated this into the following ClojureScript but to no avail:
       {:label "Test
        :icon  [reagent-material-ui.icons.mail]}]
I get the following error:
error when calling lifecycle function ....core/mount-root Error: Objects are not valid as a React child (found: object with keys {tag, id, className, displayName}). If you meant to render a collection of children, use an array instead.
How do I pass props of the type "node" properly? Many thanks in advance.

Christopher Thonfeld-Guckes14:01:58

I was hoping to avoid importing "naked" js components and use the ones already wrapped in reagent-material-ui. Guessing thats not possible in this case then?


No idea about wrappers. Probably they handle this in some way.


And the as-element also works with wrapper elements.

Christopher Thonfeld-Guckes14:01:18

Unfortunately it doesn't. I'll see what else I can find on the matter. Thanks for the help.

Christopher Thonfeld-Guckes14:01:28

I restarted shadowcljs and now it works... Thanks 🙂

Daniel Tobias21:01:44

if i make a reagent-frontend project, how can i produce a simple compiled javascript that i can move to my django's static folder ?


clj -m cljs.main --optimizations advanced -c myname.myapp


out/main.js is the file