Fork me on GitHub
#clojurescript
<
2020-10-08
>
Trung Dinh08:10:40

Hi, not sure how to import material ui icons, I’ve tried both

["@material-ui/icons/InboxIcon" :refer [InboxIcon]]
and
["@material-ui/icons" :refer [InboxIcon]]
But none of them work, appreciate any help, cheers

p-himik08:10:14

If you're using shadow-cljs, it should be ["@material-ui/icons/InboxIcon" :default InboxIcon].

Trung Dinh09:10:38

thanks, yes I use shadow-cljs, strange I still got

[:app] Build failure:
The required JS dependency "@material-ui/icons/InboxIcon" is not available, it was required by "iam_frontend/core.cljs".
I already did “npm install @material-ui/icons”…

p-himik09:10:11

Does your directory structure looks in any way similar?

p-himik09:10:23

Try stopping shadow-cljs, removing all build artifacts and the .shadow-cljs directory, and launching shadow-cljs again.

Trung Dinh09:10:29

all good, it should be “@material-ui/icons/Inbox” instead of “InboxIcon”

Trung Dinh09:10:35

many thanks again

p-himik09:10:43

Ah, right. HPH