Fork me on GitHub
#reagent
<
2021-09-20
>
hbprince02:09:07

Hi all i am using material-ui with reagent (shadow-cljs) for some components i am getting undefined error for example ListItemText is working correctly but when using MenuItem or ListItemButton (i think both have a ButtonBase as parent component) console throws "Uncaught TypeError: _MenuItem is undefined" is this has anything to do with shadow or reagent?

hbprince02:09:18

for some components it is throwing "_ButtonBase undefined" error It seems like a build processing error happened in shadow or reagent

p-himik07:09:41

How do you require the components?

hbprince07:09:28

(ns components.generic (:require ["@mui/material/Drawer" :default drawer] ["@mui/material/List" :default sidebar-menu] ["@mui/material/ListItemButton" :default sidebar-menu-item] ["@mui/material/AppBar" :default app-bar] ))

p-himik08:09:12

No clue - that looks alright. Huh, didn't know they renamed their packages in 5.0.0.

👍 2
hbprince08:09:47

Is there any specific shadow-cljs compile options needed for external react components ?

p-himik08:09:28

Try adding :compiler-options {:output-feature-set :es5} to the shadow-cljs build configuration. It seems to work for me.

👍 4
hbprince10:09:21

I think i missed that part!

p-himik10:09:27

You didn't. :) The documentation says that ES5 is the default, but actually shadow-cljs uses ES6 now. I've created an issue for that.

👍 6