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.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.
Unfortunately it doesn't. I'll see what else I can find on the matter. Thanks for the help.
https://github.com/arttuka/reagent-material-ui/blob/master/example/src/example/core.cljs#L136
I restarted shadowcljs and now it works... Thanks 🙂
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
https://clojurescript.org/guides/quick-start#production-builds