This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-07-04
Channels
- # announcements (5)
- # beginners (56)
- # calva (2)
- # cider (30)
- # circleci (2)
- # cljsrn (90)
- # clojars (3)
- # clojure (18)
- # clojure-dev (9)
- # clojure-europe (3)
- # clojure-greece (14)
- # clojure-ireland (6)
- # clojure-italy (6)
- # clojure-nl (7)
- # clojure-norway (1)
- # clojure-spec (1)
- # clojure-sweden (3)
- # clojure-uk (14)
- # clojurescript (52)
- # cursive (5)
- # data-science (9)
- # datomic (3)
- # emacs (26)
- # expound (11)
- # figwheel (3)
- # figwheel-main (6)
- # fulcro (24)
- # garden (1)
- # graalvm (101)
- # liberator (1)
- # mount (1)
- # off-topic (1)
- # pathom (27)
- # portland-or (2)
- # reagent (13)
- # reitit (2)
- # ring (1)
- # shadow-cljs (10)
- # spacemacs (11)
- # sql (6)
When using create-class, how can I access this
from my custom functions on the class? this-as
is giving me window, but the create-react-class docs say that the function should be bound with the correct this automatically.
I think there’s either a reagent.core/this
or reagent.core/component
function that you might use?
there's a current-component function, but it didn't work in that context. I don't know the impl, I'm guessing it looks for a bound this?
if you’re tearing them off the object and passing them in (e.g. as event handlers):
:doThing (fn [] (this-as this
(js/console.log this)))
:render (fn [this]
[:button {:on-click (.-doThing this)} “Click”])
Now, I am thinking of how I import an icon in cljs and reagent code.
import LockOutlinedIcon from '@material-ui/icons/LockOutlined';
<Avatar className={classes.avatar}>
<LockOutlinedIcon />
</Avatar>
Another thing is style in Material UI. Mui is using makeStyles for doing this:
import { makeStyles } from '@material-ui/core/styles';
const useStyles = makeStyles(theme => ({
'@global': {
body: {
backgroundColor: theme.palette.common.white,
}
.....
Please let me know if anyone knows cljs code.