Fork me on GitHub
#clojurescript
<
2020-10-05
>
ns15:10:55

Hi, Clojurescript beginner here, I'm trying to integrate MaterializeCss into my project, specifically SideNav component, but i'm unsure how to do so from Clojurescript. I'm trying to write this line in CLJS but it says that var M is undefined: var instance = M.Sidenav.getInstance(elem); I've included materialize css at the top of html file before the application code. Here is the documentation for this library: https://materializecss.com/sidenav.html Update: so far I've figured out that I can get access to "M" by defining it like so (def M (js* "M")) Still don't know how to pull off this one though: var instance = M.Sidenav.getInstance(elem);

rberger05:10:50

@U01BJBB1HB5 Check out https://roman01la.github.io/javascript-to-clojurescript/ it has made life a lot easier for this kind of stuff

Rama09:10:07

Yes, this has made my life easy too... thank you @U07GPFFAS

ns14:10:32

@U07GPFFAS Great tool, thank you!

thheller16:10:24

(let [instance (js/M.Sidenav.getInstance elem)] ...)

ns16:10:45

@thheller Thank you so much!