This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-12-07
Channels
- # adventofcode (202)
- # aleph (8)
- # announcements (13)
- # architecture (1)
- # aws (2)
- # beginners (201)
- # boot (1)
- # bristol-clojurians (1)
- # calva (2)
- # cider (23)
- # cljs-dev (22)
- # cljsrn (2)
- # clojure (105)
- # clojure-bangladesh (1)
- # clojure-berlin (8)
- # clojure-dev (104)
- # clojure-europe (3)
- # clojure-italy (5)
- # clojure-losangeles (1)
- # clojure-nl (24)
- # clojure-russia (55)
- # clojure-spec (44)
- # clojure-uk (19)
- # clojurescript (58)
- # component (58)
- # cursive (3)
- # data-science (1)
- # datomic (27)
- # duct (6)
- # events (6)
- # figwheel-main (6)
- # fulcro (15)
- # jobs (3)
- # kaocha (5)
- # luminus (1)
- # music (1)
- # nrepl (2)
- # off-topic (24)
- # onyx (1)
- # pedestal (3)
- # protorepl (8)
- # re-frame (18)
- # reagent (39)
- # reitit (1)
- # remote-jobs (1)
- # ring (15)
- # rum (11)
- # shadow-cljs (5)
- # sql (8)
- # tools-deps (12)
- # vim (7)
You may use [:> comp {:props}]
for react components, but you'll have to transpile JSX first. There is official documentation for that on the cljs compiler docs, and you can find :>
on reagent docs
hi all. What is the recommended way of applying error boundaries to a reagent 0.8.x app?
googling i came upon this: https://github.com/reagent-project/reagent-cookbook/wiki/Error-Boundary but it seems outdated because recalcitrant
seems to geared towards React 15.
This changelog indicates it is now supported by reagent itself: https://github.com/reagent-project/reagent/blob/v0.8.0-alpha2/test/reagenttest/testreagent.cljs#L1003-L1004 Is that right?
i figured it out. This link is outdated: https://github.com/reagent-project/reagent-cookbook/wiki/Error-Boundary
The solution is to just replicate what is done in that unit test: https://github.com/reagent-project/reagent/blob/v0.8.0-alpha2/test/reagenttest/testreagent.cljs#L1003-L1004
is there a function in reagent to add props to an element? if i wanted to add a :key
prop from a function, for instance
another way to ask that question - is there a way to mark a component as "all of my children are static, you do not have to warn me that they all need a key - i promise to add a :key
in a for loop!". Adding the key metadata to every element is like 20% of the text in my views (slight hyperbole)
@hoopes would this solve your problem?
(into [:div] [[:div "hello"] [:div "world"]])
<---- no keys needed
whereas this will trigger key warnings ...
[:div '([:div "hello"] [:div "world])]
Further explanation https://stackoverflow.com/questions/37164091/how-do-i-loop-through-a-subscribed-collection-in-re-frame-and-display-the-data-a/37186230#37186230
yeah, i was wrapping material components with something like
(defn grid [props child & children]
[:> Grid props child children])
and i think i'm applying the children argument incorrectly (where the destructuring turns it into a seq?)
but i did see your answer to that SO question, and didn't understand how i wasn't doing something verrrry close to that, but i'm pretty sure i'm just making dumb beginner mistakes
Test:
(defn grid [props child & children]
[:> Grid props child (vec children)]) <--- note use of vec
Test #2
(defn grid [props child & children]
(into [:> Grid props child] children))
Dunno enough about Grid
to know which of these will be right for you
Uncaught Error: Invalid arity: 3
both of them are giving me this error, but thank you - i will definitely experiment with these
it's 5PM EST on a friday - i'm gonna take a break, but thanks again, and thanks for re-frame!
much later than 5pm for @mikethompson I believe
9am in the morning here :-)
11am on Saturday over there