This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-03-20
Channels
- # aleph (15)
- # announcements (12)
- # aws-lambda (1)
- # babashka (54)
- # beginners (35)
- # calva (2)
- # cider (31)
- # clerk (13)
- # clj-kondo (65)
- # clj-on-windows (14)
- # cljsrn (7)
- # clojure (57)
- # clojure-art (1)
- # clojure-dev (1)
- # clojure-europe (19)
- # clojure-nl (1)
- # clojure-norway (7)
- # clojure-uk (1)
- # clojurescript (9)
- # community-development (25)
- # cursive (2)
- # data-science (3)
- # emacs (19)
- # events (1)
- # fulcro (21)
- # humbleui (1)
- # hyperfiddle (15)
- # jobs (8)
- # london-clojurians (2)
- # malli (18)
- # off-topic (1)
- # portal (6)
- # reagent (3)
- # releases (3)
- # sci (1)
- # shadow-cljs (73)
- # spacemacs (4)
- # sql (9)
I'm having trouble understanding why this does not call [payment-entry] 3 times
defn payment-entry []
[:div {:class ["form-window-visible"]}
[:p {:id "payment-date:" :class ["bg-blue-50"] } "payment date " name]
[:p {:id "payment-amount"} "amount test: " name]
[:p {:id "payment-receipt"} "receipt: "name]
;; this is a url
[:p "test" ]])
(defn invoice-container-tree [invoice-title name items]
[:div {:id "tree-invoice" :class ["form-window-visible"]}
[invoice-id-and-num]
[:p {:class ["text-basic"]} "this is a test of the description and how it will look"]
[:p {:class ["text-basic"]} "Current balance: " name]
[invoice-payment-make]
[:button {:class ["button-basic" "p-3"] :on-click #(swap! is-show-form not)} "View past payments"]
(if @is-show-form
[invoice-payment-previous])
(if (and @is-show-form @is-show-p1)
(for [item items] [payment-entry]))])
;; need
(defn childcaller []
[invoice-container-tree "Example-Project" "invoice-container-tree" (range(3))])
if the (for [item items] is placed in front of each [:p of payment-entry, then it will print the (range(3)) for each, but my goal is to print the component 3 times (one for each previous payment, assuming there are 3 previous payments). Putting the for in front of [:div returns a react error✅ 2
Your code shouldn't work at all because (range(3))
is not a valid expression. It should be (range 3)
.
✅ 2
Thanks once again. Child-container wasn't being called by mountit. It worked as intended fixing range and calling it correctly. I apologize for posting something I could have probably caught if my linter was on, need to configure it
👍 2