reactjs - In ClojureScript, how do I properly use cljsjs/react-mdl? -
i've been struggling cljsjs
libraries, , i've spent 2 full days worth of life playing interop of react-bootstrap
, , various material
libraries in clojurescript.
basically, want able ui components clojurescript projects. if can recommend better cljsjs/react-mdl
, i'd love it. if know how current bugs, i'd love too!
i have:
(ns project.views (:require [cljsjs.react-mdl])) (def button (aget js/reactmdl "button"))
and error:
reactmdl not defined
in javascript console.
i want 1 react-mdl
button showing on screen.
i'm using wrapper: https://github.com/cljsjs/packages/tree/master/react-mdl
for library: https://github.com/tleunen/react-mdl
and these interop instructions on cljsjs: https://github.com/cljsjs/packages/wiki/using-packages
i'm using clojure's reagent, , reframe, if matters. honestly, want project out door built clojure , relevant libs, if can recommend use different stack, please do!
am overlooking simple?
i'll answer getting button going.
i didn't use cljs libraries. used css
, js
supplied. need in markup, , link material design icons library.
this example in reagent:
[:input {:type "submit" :classname "mdl-button mdl-js-button mdl-button--fab mdl-js-ripple-effect mdl-button--colored" :value "ok"}]
and in om next:
(defui mdsubmitbutton object (render [this] (dom/button (clj->js {:classname "mdl-button mdl-js-button mdl-button--fab mdl-js-ripple-effect mdl-button--colored"}) (dom/i (clj->js {:classname "material-icons"}) "add")))) (def md-submit-button (om/factory mdsubmitbutton {:keyfn :id}))
i'm quite new this, preference use css
, keep javascript minimum, , build components manually in whatever react wrapper project using.
Comments
Post a Comment