This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-07-30
Channels
- # announcements (4)
- # babashka (8)
- # beginners (124)
- # calva (13)
- # cider (10)
- # circleci (6)
- # clj-kondo (193)
- # cljdoc (1)
- # cljs-dev (4)
- # clojure (50)
- # clojure-europe (28)
- # clojure-serbia (1)
- # clojure-spec (22)
- # clojure-uk (30)
- # clojurescript (11)
- # clojureverse-ops (3)
- # community-development (1)
- # conjure (5)
- # cursive (1)
- # datomic (11)
- # depstar (1)
- # events (2)
- # fulcro (7)
- # graalvm (2)
- # graphql (10)
- # helix (43)
- # hyperfiddle (14)
- # introduce-yourself (6)
- # jobs (2)
- # jobs-discuss (14)
- # kaocha (4)
- # luminus (2)
- # malli (24)
- # meander (6)
- # off-topic (4)
- # pathom (1)
- # polylith (13)
- # re-frame (6)
- # releases (1)
- # remote-jobs (1)
- # sci (14)
- # shadow-cljs (209)
- # tools-deps (30)
- # xtdb (26)
You cannot use load-file with Clojurescript AFAIK
https://cljs.github.io/api/cljs.core/load-file Only usable from the repl.
How does one 'destructure' to a map, i.e. the equivalent of the JavaScript {...props}
where the data from props would populate the map for the following ClojureScript: [icon {}]
most probably you are looking for merge
(let [defaults {:width 20 :height 20}]
[icon (merge {:color “red”} defaults)])
merge is right to left. and it is shallow. if you need deep-merge there are a few implementations around.(let [{:keys [a b c] :as x} {:a 1 :b 2 :c 3}]
(println "a" a)
(println "b" b)
(println "c" c)
(println "x" x)
)
a 1
b 2
c 3
x {:a 1, :b 2, :c 3}
This is an example of clojure destructuring, though javi might be right and I misunderstood)Basically I'm trying to create a component that passes its props to the component it wraps. Like this:
const AntTabs = withStyles({
root: {
borderBottom: '1px solid #e8e8e8',
},
indicator: {
backgroundColor: '#1890ff',
},
})(Tabs);
const AntTab = withStyles((theme) => ({
root: {
textTransform: 'none',
minWidth: 72,
fontWeight: theme.typography.fontWeightRegular,
marginRight: theme.spacing(4),
fontFamily: [
'-apple-system',
'BlinkMacSystemFont',
'"Segoe UI"',
'Roboto',
'"Helvetica Neue"',
'Arial',
'sans-serif',
'"Apple Color Emoji"',
'"Segoe UI Emoji"',
'"Segoe UI Symbol"',
].join(','),
'&:hover': {
color: '#40a9ff',
opacity: 1,
},
'&$selected': {
color: '#1890ff',
fontWeight: theme.typography.fontWeightMedium,
},
'&:focus': {
color: '#40a9ff',
},
},
selected: {},
}))((props) => <Tab disableRipple {...props} />);
I'm a beginner using shadow-cljs. I'm getting a message "Stale Output! Your loaded JS was not produced by the running shadow-cljs instance. Is the watch for this build running?" I am running "shadow-cljs watch app" in the terminal. I'm also running "lein run" in another terminal, or else the localhost webpage doesn't load (is that the correct way to do things?). What can I do to figure out why this message is coming up?
When I run "shadow-cljs compile app", the terminal says "Build completed" but in localhost I get the message "shadow-cljs - Reconnecting..."