(def atm (reagent/atom "foo"))
(defn f3
[a b]
(js/console.log "test-component")
(reagent/create-class
{:display-name "test"
:component-did-update
(fn [this prev-argv]
(print "prev-argv = " prev-argv)
(print "argv = " (reagent/argv this))
(print "props = " (reagent/props this))
(print "children = " (reagent/children this)))
:reagent-render
(fn [a b]
[:div (str (:val a) b)])}))
(defn test-component []
[f3 {:val @atm} @atm])
(js/setTimeout (fn []
(js/console.log "updating")
(reset! atm "FOO"))
1)
=>
new-state = cljs.core/PersistentHashMap [count: 9]
test-component
updating
prev-argv = [#object[Constructor] {:val foo} foo]
argv = [#object[Constructor] {:val FOO} FOO]
props = {:val FOO}
children = [FOO]