component

chooie 2017-02-18T01:32:53.000046Z

Has anyone had success using component with cljs and reagent? I can render correctly on load. However, every time I make a code change and the cljs code is reloaded, it seems the html head and body are wiped clean. I’m using boot with boot-cljs and boot-reload

martinklepsch 2017-02-18T04:12:48.000047Z

@chooie: if you could paste your startup code that might help. Also maybe more a question for #boot than here but we'll see :)

chooie 2017-02-18T06:58:51.000048Z

Thanks Martin. I figured out the issue - I was calling this function on every reload:

(defn hook-browser-navigation!
  []
  (doto (History.)
    (events/listen
      HistoryEventType/NAVIGATE
      (fn [event]
        (when (not-empty (.-token event))
          (secretary/dispatch! (.-token event)))))
    (.setEnabled true)))
This was because I started calling this function in the routing component’s start function during a refactor to make my code into components. I wasn’t able to see the error properly because I believe that componentizing the frontend of the app has somehow messed with the error reporting…more digging to do