This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-12-01
Channels
- # adventofcode (93)
- # announcements (44)
- # asami (23)
- # aws (1)
- # babashka (48)
- # beginners (112)
- # calva (26)
- # cider (57)
- # clj-kondo (17)
- # cljfx (5)
- # cljs-dev (21)
- # clojure (124)
- # clojure-europe (19)
- # clojure-hungary (40)
- # clojure-nl (3)
- # clojure-spec (7)
- # clojure-uk (3)
- # clojurescript (3)
- # cursive (81)
- # datalog (11)
- # events (21)
- # exercism (1)
- # fulcro (37)
- # graalvm (1)
- # introduce-yourself (8)
- # jobs (1)
- # lsp (1)
- # malli (5)
- # membrane-term (17)
- # minecraft (3)
- # nextjournal (5)
- # off-topic (14)
- # other-lisps (14)
- # polylith (58)
- # reagent (16)
- # reclojure (3)
- # reitit (6)
- # remote-jobs (1)
- # shadow-cljs (55)
- # spacemacs (15)
- # testing (2)
- # tools-build (7)
- # tools-deps (191)
How do I go about passing all props down? Similar to {…restProps}
If you need to pass additional props, you just assoc
or merge
something into that map.
If you need to pass all the props except some, you just dissoc
the unneeded ones.
I dont think the children are being passed through properly
oh wait
[
{:keys [on-click class variant is-full-width disabled?] :as btn-props}
{:keys [left-icon right-icon icon-spacing icon-styles] :as icon-props}
children]
is it possible to do somethign like thisI want to separate icon and btn props, so that way I can just pass down icon-props
rather than all of them
So you have a button component that has its own props and also has a button inside that should have its own props?
kinda yeah
ideally i just want to pass a few specific props into my btn-content
component, not all of them
You can just combine the two prop maps, assuming the names don't conflict.
Or you can make the component more composable by passing just one :label
prop - then the user of the button will decide what icon will go where, if anywhere.
> You can just combine the two prop maps, assuming the names don’t conflict. what does this mean
oh so what i did above in the img ^
In React I’d just declare this and pass it
const contentProps = { rightIcon, leftIcon, iconSpacing, children }
not sure how to declare in a let