This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-09-10
Channels
- # beginners (151)
- # cider (41)
- # cljdoc (7)
- # cljs-dev (6)
- # clojure (92)
- # clojure-dev (5)
- # clojure-italy (26)
- # clojure-losangeles (1)
- # clojure-nl (10)
- # clojure-russia (3)
- # clojure-spec (23)
- # clojure-uk (82)
- # clojurescript (56)
- # clojutre (1)
- # core-async (3)
- # cursive (15)
- # datomic (26)
- # editors (3)
- # emacs (3)
- # events (2)
- # figwheel-main (192)
- # fulcro (66)
- # leiningen (12)
- # mount (1)
- # off-topic (131)
- # portkey (6)
- # re-frame (38)
- # reagent (10)
- # reitit (7)
- # ring-swagger (55)
- # shadow-cljs (21)
- # spacemacs (11)
- # tools-deps (48)
Hi, did somebody get withMobileDialog
from material ui working with a reagent component?I just cannot get it working, no matter which combination I try.
I get the "functions are not valid as react child. this may happen if you return Component instead of <Component /> from render" error. But how would I wrap a component into the withMobileDialog
component?
To add some more context. In plain javascript you would do this:
export default withMobileDialog()(ResponsiveDialog);
where ResponsiveDialog is a react component.try
(def responsive-dialog* (r/reactify-component responsive-dialog))
[:> ((withMobileDialog) responsive-dialog*) {:prop :go-here}]
assuming that responsive-dialog-dialog is a Reagent component
@pesterhazy was faster. ๐ Was just going to paste this here:
(defn my-dialog [{:keys [fullScreen]}]
[mui/dialog {:open true
:fullScreen fullScreen}
[mui/typography "Some content"]])
(def with-mobile-dialog (.withMobileDialog js/MaterialUI))
(defn my-view []
[:> (with-mobile-dialog (r/reactify-component my-dialog))])
Where mui/dialog
is MaterialUI dialog wrapped with adapt-react-class
. You could use :>
syntax as well
Btw hereโs a nice interop cheat sheet for reagent and MaterialUI https://github.com/reagent-project/reagent/blob/master/examples/material-ui/src/example/core.cljs