Did you export your components?
Any idea why a component may not be updating in a firefox extension content script? Basically doing
(def test-atom (r/atom {}))
(defn test-comp [] [:div "Test " (:text @test-atom)])
(defn init []
(let [el (. js/document createElement "div")]
(rdom/render [test-comp] el)
(.. js/document -body (appendChild el))
(swap! test-atom assoc :text "works"))))
in the extension's content script produces a div with "Test", not "Test works". It works in chrome but not firefox. The atom is being changed, but test-comp is not being rerendered. Have tried with swapping render
and appendChild
, same result.After a couple of hours of debugging reagent, discovered that this has been fixed and I have been using an outdated version of reagent 🤦 https://github.com/reagent-project/reagent/issues/438