This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-07-07
Channels
- # beginners (19)
- # cider (20)
- # cljs-dev (2)
- # cljsjs (2)
- # clojure (61)
- # clojure-spec (13)
- # clojure-uk (12)
- # clojurescript (12)
- # core-typed (1)
- # cursive (16)
- # data-science (30)
- # datomic (37)
- # fulcro (8)
- # hoplon (7)
- # jobs-discuss (1)
- # onyx (21)
- # planck (18)
- # protorepl (1)
- # re-frame (2)
- # reagent (1)
- # shadow-cljs (6)
- # tools-deps (4)
Hey, one question about props
.
In Material UI there’s something like composition
<GridList className={classes.gridList} cols={2.5}>
{tileData.map(tile => (
<GridListTile key={tile.img}>
<img src={tile.img} alt={tile.title} />
<GridListTileBar
title={tile.title}
classes={{
root: classes.titleBar,
title: classes.title,
}}
actionIcon={
<IconButton>
<StarBorderIcon className={classes.title} />
</IconButton>
}
/>
</GridListTile>
))}
</GridList>
So here GridListTile
needs to be under GridList
. I’ve trying to move GridListTile
to a wrapper component, but then I’d need to pass the this.props.style
to keep the styling, like this
<GridListTile cols={1} style={{...this.props.style, background: 'green'}} onClick={this.handleClick}>
{this.props.id}
</GridListTile>
Is there any common way of doing so in Reagent Cljs?Thank you. Can you give me an idea how to connect these?
[:> GridList {:cell-height 180 :cols 3}
(for [image @images]
(let [image-key (get-in image [:details :id])]
^{:key image-key}
(m/let [classes ...?]
[grild-tile image])))]
I’m probably suppose to get these styles here, but not sure how. Cheers!@U2J4FRT2T and how can I extract props.style
from it? theme.props
seem to be empty
By myself I mean, with sass for the time being. In a moment I'll figure it out and post it here :)
👍 4
anyone know of a clj-js alternative that maintains namespaces? Like cheshire does for clojure
You can do it by providing custom keyword-fn (clj->js {:user/email ""} :keyword-fn #(str (namespace %) "/" (name %)))