mirror of https://github.com/status-im/reagent.git
Tune material-ui comments
This commit is contained in:
parent
019df6bbd1
commit
0644eafe59
|
@ -78,13 +78,16 @@
|
||||||
[:> Autocomplete {:options ["foo" "bar" "foobar"]
|
[:> Autocomplete {:options ["foo" "bar" "foobar"]
|
||||||
:style {:width 300}
|
:style {:width 300}
|
||||||
;; Note that the function parameter is a JS Object!
|
;; 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]
|
:render-input (fn [^js params]
|
||||||
;; Don't call js->clj because that would
|
;; Don't call js->clj because that would recursively
|
||||||
;; recursively convert all JS objects (e.g. React ref objects)
|
;; convert all JS objects (e.g. React ref objects)
|
||||||
;; to Cljs maps, which breaks them, even when converted back to JS.
|
;; to Cljs maps, which breaks them, even when converted back to JS.
|
||||||
;; Best thing is to use r/create-element and
|
;; Best thing is to use r/create-element and
|
||||||
;; pass the JS params to it. If necessary,
|
;; pass the JS params to it.
|
||||||
;; use JS interop to modify params.
|
;; If necessary, use JS interop to modify params.
|
||||||
(set! (.-variant params) "outlined")
|
(set! (.-variant params) "outlined")
|
||||||
(set! (.-label params) "Autocomplete")
|
(set! (.-label params) "Autocomplete")
|
||||||
(r/create-element mui/TextField params))}]])
|
(r/create-element mui/TextField params))}]])
|
||||||
|
|
Loading…
Reference in New Issue