Skip to content

Instantly share code, notes, and snippets.

@jarohen
Last active September 22, 2015 14:22
Show Gist options
  • Save jarohen/f9646aea25ff59955b36 to your computer and use it in GitHub Desktop.
Save jarohen/f9646aea25ff59955b36 to your computer and use it in GitHub Desktop.
reagent bug?
(defn child-1 [!cnt]
(let [cnt @!cnt]
(prn "child-1-mount")
(fn [!cnt]
(prn "child-1-render")
[:div
"child-1"])))
(defn parent-component []
(let [!count (r/atom 0)]
(fn []
[:div
[:span (pr-str @!count)]
[child-1 !count]
[:button {:on-click #(swap! !count inc)}
"inc"]])))
@jarohen
Copy link
Author

jarohen commented Sep 22, 2015

"child-1-mount"
core.cljs:141 "child-1-render"

clicking button causes

core.cljs:141 "child-1-render"

clicking button again causes no logs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment