Fork me on GitHub
#reagent
<
2021-01-08
>
Christopher Thonfeld-Guckes14:01:35

Hi there. I'm trying to use a reagent-material-ui component that wraps this one: https://material-ui.com/api/bottom-navigation-action/ 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:
[mui/bottom-navigation-action
       {: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.

3
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?

juhoteperi14:01:35

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

juhoteperi14:01:05

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 ?

clyfe21:01:05

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

clyfe21:01:49

out/main.js is the file