This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-06-18
Channels
- # aws (12)
- # beginners (489)
- # calva (32)
- # cider (117)
- # clj-kondo (4)
- # cljdoc (9)
- # cljs-dev (3)
- # clojure (56)
- # clojure-brasil (1)
- # clojure-europe (10)
- # clojure-italy (44)
- # clojure-nl (9)
- # clojure-russia (1)
- # clojure-sweden (6)
- # clojure-uk (64)
- # clojurescript (6)
- # cursive (6)
- # datascript (4)
- # datomic (6)
- # emacs (3)
- # fulcro (15)
- # graalvm (11)
- # jackdaw (7)
- # jobs (8)
- # jobs-discuss (29)
- # jvm (2)
- # leiningen (5)
- # luminus (10)
- # off-topic (23)
- # pathom (21)
- # planck (11)
- # quil (6)
- # re-frame (11)
- # reagent (17)
- # reitit (8)
- # rewrite-clj (6)
- # shadow-cljs (78)
- # slack-help (2)
- # spacemacs (7)
- # specter (4)
- # sql (60)
- # tools-deps (7)
- # xtdb (11)
I usually put a js/console.log
at the top-level to see if something is actually re-rendering and what’s going on
@m373h4n you're defining the r/atom
at the render level, so your changes will be lost on the re-render.
Quickest fix is to change the let
to an r/with-let
, so that the bindings are defined once at the "mount" phase.
You can also use a form-2 component, returning a render function that closes over the r/atom
(defn login []
(r/with-let [values (r/atom {:email
(defn login []
(let [values values (r/atom {:email ...})]
(fn []
[layout ...
@m373h4n you will probably find this useful https://github.com/reagent-project/reagent/blob/master/doc/CreatingReagentComponents.md