reagent

A minimalistic ClojureScript interface to React.js http://reagent-project.github.io/
2020-03-30T12:13:25.040700Z

If you make a print statement inside your reagent render, you will see that your component is recreated again everytime you click on the button. So compnoent did update is called because it is called everytime reagent-render is called.

2020-03-30T12:39:40.041Z

(defn test-comp [counter]
  (r/create-class
   {:display-name "test-comp"
    :component-did-update
    (fn [this]
      (prn "component did update"))
    :reagent-render
    (fn []
      [:div
       [:button {:on-click  #(swap! counter inc)} "click"]])}))

(defcard-rg component-test
  (let [counter (r/atom 0)]
    (fn []
      [:<>
       [:div @counter]
       [test-comp counter]])))

2020-03-30T12:40:21.041200Z

you can see that Created is only called once, and component did update is never called whenever you click the button.

2020-03-30T12:40:32.041400Z

I dunno if this answer your question.

2020-03-30T12:40:54.041600Z

but I guess it makes sense that did updated is not called because the reference (the atom) is not change.