This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-07-17
Channels
- # beginners (42)
- # cider (1)
- # cljs-dev (20)
- # clojure (73)
- # clojure-italy (8)
- # clojure-nl (53)
- # clojure-spec (11)
- # clojure-uk (88)
- # clojurescript (170)
- # clojutre (6)
- # core-async (26)
- # css (2)
- # cursive (13)
- # data-science (10)
- # datomic (15)
- # editors (3)
- # figwheel (28)
- # figwheel-main (67)
- # fulcro (57)
- # graphql (2)
- # immutant (2)
- # jobs (1)
- # jvm (4)
- # lein-figwheel (3)
- # leiningen (1)
- # off-topic (5)
- # pedestal (28)
- # re-frame (86)
- # reagent (18)
- # reitit (8)
- # ring (3)
- # ring-swagger (2)
- # shadow-cljs (78)
- # spacemacs (10)
- # specter (12)
- # tools-deps (32)
- # vim (3)
Anyone know why this would work in a shadow repl but fail in a component
(-> row vals string/join)
vals gives an error that row is not a function but row is a dict
Could someone explain why [:> Test {:foo-bar "bar"}
results in the Test getting props of {'fooBar': 'bar'}
but [:> Test #js {:foo-bar "bar"}
{'children': {'foo-bar: 'bar'}
This was a huge pain in the ass. In the end I wrote a small JS component that prints the props, since I didn't figure out a way to see which way reagent really passes props to react components
I guess it’s because in reagent props must be in a clojure map and
(map? #js{:a 2})
=> false
And because reagent doesn’t recognize js object as props it’s interpreted as children
that should be passed to the component.See https://github.com/reagent-project/reagent/blob/master/doc/UsingHiccupToDescribeHTML.md
Yeah, the props map itself needs to be a map?
; anything below that can also be a js datastructure. Agree that this is hard to grok and not well documented @tomi.hukkalainen_slac
Hi guys
can i do something like : (defn all-things [] (fn [] (doall (for [x l] [:h1 (:name x)}])))) and then [all-things] ?
and what is the meaning of this error: uncought error: Objects are not valid as React child (found: object with keys (name, id, class)) if you meant to render a collection of children, use an array instead.
@abdullahibra try wrapping the doall with a [:div ... ]
Common patterns is to do something like this
(into [:div] (for [i (range 5)]
[:h1 (str i)]))
@abdullahibra see also https://presumably.de/reagent-mysteries-part-1-vectors-and-sequences.html
I think the fact that reagent/create-element will take an #js "map" is the mental mismatch
It is clear that : > will just convert it to reagent component, which then needs a clojure map, but the magic could go either way
I'm not sure it would be possible to give warning in this case. Both uses are valid but mean different things.