This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2015-09-22
Channels
- # admin-announcements (5)
- # aws (32)
- # beginners (2)
- # boot (51)
- # cider (33)
- # cljs-dev (4)
- # clojure (83)
- # clojure-berlin (11)
- # clojure-czech (23)
- # clojure-poland (3)
- # clojure-russia (51)
- # clojure-seattle (4)
- # clojure-sg (1)
- # clojure-uk (4)
- # clojurescript (48)
- # clojurex (1)
- # datomic (26)
- # devcards (10)
- # devops (12)
- # editors (9)
- # emacs (12)
- # events (1)
- # funcool (14)
- # hoplon (117)
- # immutant (1)
- # jobs (2)
- # ldnclj (32)
- # ldnproclodo (12)
- # om (51)
- # onyx (17)
- # reagent (11)
- # yada (4)
Does anybody know why input won’t change itself if I remove fn [] ?
(defn new-contact []
(let [val (r/atom "")]
(fn []
[:div
[:input {:type "text"
:placeholder "Contact Name"
:value @val
:on-change #(reset! val (-> % .-target .-value))}]
[:button {:on-click #(when-let [c (parse-contact @val)]
(add-contact! c)
(reset! val ""))}
"Add"]])))
look into the different types of reagent forms https://github.com/Day8/re-frame/wiki/Creating-Reagent-Components#form-2--a-function-returning-a-function
@vorob i just wrote soemthing up in this: https://github.com/reagent-project/reagent-cookbook/blob/master/basics/component-level-state/README.md
@roberto: @gadfly361 💞💞💞💞💞
@roberto, qq about that document you linked to: exactly what gets passed to the inner function (the renderer function) on re-renders? I understand about the renderer function closing over the values passed to the outer function, but… I’m confused about what is actually passed to a renderer function.
Don’t the outer and inner functions need to have the same number of arguments?
Did you mean (defn a-view [] (let [p1 (something)] (fn [] … p1 …)))
?