Fork me on GitHub
#reagent
<
2018-10-12
>
kwladyka20:10:19

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.

juhoteperi20:10:08

@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])]

kwladyka20:10:36

@juhoteperi {:expand-icon (r/as-element [mui-icons/expand-more-icon])} this one work. Thank you! 🍻

kwladyka20:10:52

I was trying it, but without [] 😕

juhoteperi20:10:44

The first suggestion needed r/create-element call

kwladyka20:10:39

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.

juhoteperi21:10:19

I didn't decide to have examples in the same repo, Reagent has had examples in the repo for a long time

juhoteperi21:10:35

Adding material-ui was logical as there were others

juhoteperi21:10:13

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