Fork me on GitHub
#reagent
<
2017-01-27
>
rorydouglas22:01:04

anyone here have experience using cljs-react-material-ui ? Specifically, i’m trying to using the HOC muiThemable from http://www.material-ui.com/#/customization/themes to wrap my custom reagent component & can’t figure out how to do it

rorydouglas22:01:45

the javascript usage for it is: muiThemeable()(ReactComponetClassToWrap);

rorydouglas22:01:13

you’d treat the result as a ReactComponent

rorydouglas22:01:37

i’ve tried this:

(defn mui-themeable
  [wrapped]
  (let [wrapped-comp (reagent/reactify-component wrapped)
        mui-theme-fn (js/MaterialUIStyles.muiThemeable)]
    (reagent/adapt-react-class (mui-theme-fn wrapped-comp))))

rorydouglas22:01:20

then used it like this:

(let [themed-comp (mui-util/mui-themeable my-comp-using-theme)]
[themed-comp arg1 arg2]

madvas23:01:08

@rorydouglas haven’t tried muiThemeable yet, can’t try it at the moment 😕