reagent

A minimalistic ClojureScript interface to React.js http://reagent-project.github.io/
Christopher Thonfeld-Guckes 2021-01-08T14:36:35.001100Z

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.

✅ 1
Christopher Thonfeld-Guckes 2021-01-08T14:40:58.001600Z

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?

juhoteperi 2021-01-08T14:44:35.001800Z

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

juhoteperi 2021-01-08T14:45:05.002Z

And the as-element also works with wrapper elements.

Christopher Thonfeld-Guckes 2021-01-08T14:49:18.002300Z

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

Christopher Thonfeld-Guckes 2021-01-08T14:52:28.002800Z

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

Daniel Tobias 2021-01-08T21:35:44.004Z

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 ?

clyfe 2021-01-08T21:49:05.004100Z

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

clyfe 2021-01-08T21:57:49.004300Z

out/main.js is the file