This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-07-25
Channels
- # aleph (2)
- # aws (2)
- # beginners (37)
- # boot (23)
- # cider (29)
- # clara (34)
- # cljs-dev (2)
- # cljsrn (17)
- # clojure (230)
- # clojure-dev (47)
- # clojure-italy (11)
- # clojure-nl (2)
- # clojure-poland (5)
- # clojure-russia (52)
- # clojure-sg (1)
- # clojure-spec (70)
- # clojure-uk (73)
- # clojurescript (31)
- # core-async (9)
- # cursive (15)
- # datomic (39)
- # events (1)
- # graphql (1)
- # lein-figwheel (2)
- # luminus (13)
- # off-topic (2)
- # onyx (29)
- # other-lisps (1)
- # parinfer (15)
- # pedestal (14)
- # re-frame (41)
- # reagent (24)
- # ring (4)
- # ring-swagger (12)
- # rum (1)
- # spacemacs (3)
- # specter (1)
- # test-check (13)
- # timbre (9)
- # unrepl (29)
- # vim (5)
Anyone know of good reads when it comes to naming stuff? Specifically defining function args?
for the life of me i can't figure out how to construct a basic dropdown using this cljs ant-design react wrapper: https://github.com/priornix/antizer
(defn menu []
(fn []
[ant/menu
[ant/menu-item "one"]
[ant/menu-item "two"]
[ant/menu-item "three"]]))
(defn dd [] [ant/dropdown [menu]]) ; No dice
(defn dd [] [ant/dropdown {:overlay [menu]}]) ; Nuh uh
(defn dd [] [ant/dropdown {:overlay menu}]) ; I didn't think this would work regardless, but nope!
The key thing is that ->>
puts the argument at the end, so you were expanding with the result at the end (-> (nth 3) +it-went-here+)
yeah I expected that within the context of the thread-first it would put the argument in the correct place
@joshkh from the examples all of the components seem to be functions i.e.
(ant/menu
(ant/menu-item "one")
(ant/menu-item "two"))
see https://github.com/priornix/antizer/blob/master/examples/src/antizer_examples/rum.cljs#L278
@joshkh maybe lose the lambda in menu
(defn menu []
[ant/menu
[ant/menu-item "one"]
[ant/menu-item "two"]
[ant/menu-item "three"]])
(defn dd [] [ant/dropdown {:overlay menu}])
`it looks like the only difference between that and my third example is that the menu
component is form1
nope, same error: antd.inc.js:32809 Uncaught TypeError: Cannot read property 'props' of undefined
@joshkh This works
(defn menu []
[ant/menu {:mode "vertical" :theme "dark" :style {:height "100%"}}
[ant/menu-item "one"]
[ant/menu-item "two"]
[ant/menu-item "three"]])
(defn dd [] [ant/dropdown {:overlay (r/as-element (menu))} [:a {:className "ant-dropdown-link" :href "#"} [:span "Choose me!"]]])
thanks, @gmercer ! one small change i had to make - (reagent/as-element [menu])
rather than (menu)
(... might be a rum thing). the dropdowns don't close though after being selected. weird. but that solves the reagent problem, thanks!
@joshkh I think you're mixing reagent and ŝablono here. That might be why you're having issues.
Hey what is the lighttable plug in for paran shortcuts?
Thanks @val_waeselynck