Last active
September 22, 2015 14:22
-
-
Save jarohen/f9646aea25ff59955b36 to your computer and use it in GitHub Desktop.
reagent bug?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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"]]))) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
clicking button causes
clicking button again causes no logs