From 0644eafe59bd747b1e8660a95659206797ab496b Mon Sep 17 00:00:00 2001 From: Juho Teperi Date: Sun, 22 Mar 2020 19:05:46 +0200 Subject: [PATCH] Tune material-ui comments --- examples/material-ui/src/example/core.cljs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/examples/material-ui/src/example/core.cljs b/examples/material-ui/src/example/core.cljs index 3ccd26f..568fa18 100644 --- a/examples/material-ui/src/example/core.cljs +++ b/examples/material-ui/src/example/core.cljs @@ -78,13 +78,16 @@ [:> Autocomplete {:options ["foo" "bar" "foobar"] :style {:width 300} ;; Note that the function parameter is a JS Object! + ;; Autocomplete expects the renderInput value to be function + ;; returning React elements, not a component! + ;; So reactify-component won't work here. :render-input (fn [^js params] - ;; Don't call js->clj because that would - ;; recursively convert all JS objects (e.g. React ref objects) + ;; Don't call js->clj because that would recursively + ;; convert all JS objects (e.g. React ref objects) ;; to Cljs maps, which breaks them, even when converted back to JS. ;; Best thing is to use r/create-element and - ;; pass the JS params to it. If necessary, - ;; use JS interop to modify params. + ;; pass the JS params to it. + ;; If necessary, use JS interop to modify params. (set! (.-variant params) "outlined") (set! (.-label params) "Autocomplete") (r/create-element mui/TextField params))}]])