This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-10-12
Channels
- # beginners (58)
- # boot (4)
- # calva (1)
- # cider (13)
- # cljdoc (1)
- # cljs-dev (7)
- # cljsrn (14)
- # clojure (93)
- # clojure-canada (1)
- # clojure-conj (1)
- # clojure-germany (1)
- # clojure-italy (6)
- # clojure-losangeles (3)
- # clojure-nl (8)
- # clojure-spec (6)
- # clojure-uk (77)
- # clojurescript (3)
- # cursive (5)
- # data-science (6)
- # datomic (52)
- # emacs (1)
- # figwheel-main (2)
- # fulcro (6)
- # graphql (7)
- # jobs (9)
- # leiningen (1)
- # luminus (15)
- # mount (14)
- # off-topic (94)
- # pedestal (1)
- # re-frame (7)
- # reagent (10)
- # shadow-cljs (75)
- # spacemacs (4)
- # test-check (15)
- # tools-deps (23)
- # unrepl (1)
https://material-ui.com/style/icons/
<ExpansionPanelSummary expandIcon={<ExpandMoreIcon />}>
...
</ExpansionPanelSummary>
How to do expandIcon={<ExpandMoreIcon />}
?
I was trying to do it in many ways, like:
[mui/expansion-panel-summary
;{:expand-icon [mui-icons/expand-more-icon]} ;; this throw an error
[:p "1a"]
[mui-icons/expand-more-icon] ;; this work
]
Warning: Failed prop type: Invalid prop `expandIcon` supplied to `ExpansionPanelSummary`, expected a ReactNode.
I define icon as (def expand-more-icon (r/adapt-react-class mui-icons/ExpandMore))
but I was trying also without r/adapt-react-class
.@kwladyka Try [mui/expansion-panel-summary {:expand-icon mui-icons/ExpandMore} ...]
(directly accessing the JS fn) or [mui/expansion-panel-summary {:expand-icon (r/as-element [mui-icons/expand-more-icon])]
@juhoteperi {:expand-icon (r/as-element [mui-icons/expand-more-icon])}
this one work. Thank you! 🍻
I added example of this to the repo: https://github.com/reagent-project/reagent/commit/d0812152bcfeae75c4a3dd09314f7d624657c01a
The first suggestion needed r/create-element
call
BTW Why did you decide to have examples in the same repo with reagent instead of separate one? I am considering similar thing, but I decided to create separate one. Not sure about that.
I didn't decide to have examples in the same repo, Reagent has had examples in the repo for a long time
Adding material-ui was logical as there were others
Depending on the tools you use, it can be easier to work with lib and examples at the same time if they are on one project