I just added a modal dialog to my reagent/re-frame project, code is in a new namespace. The namespace reloads (js/console.log debug output) but if I make changes to the component, they will not update (although the namespace did reload). Changes in other files are shown immediately. What do I miss? (It's been a while since I used shadow and reagent... maybe I just forgot something essential here?)
Reloading the page in the browser will show the change but not hot-reloading for some reason?
I found the problem... I "installed" the modal dialog in a conditional (case) part of my DOM tree and that might have prevented reagent to update.
https://code.thheller.com/blog/shadow-cljs/2019/08/25/hot-reload-in-clojurescript.html
see "Things to avoid"
could just be that reagent/react decide that the component doesn't need to re-render because something in the component tree wasn't actually updated
Thanks for the hint @thheller. In my case I have some "tabbed" ui, where a case statement decides which tab content to render. I defined the model dialog (reagent component) within one of these tabs. Although this particular tab and the dialog were visible, the dialog did not update. Lifting the modal dialog in the DOM hierarchy outside the case statement did fix the problem.
I'm not happy with this solution because the dialog is part of the tab and this kind of breaks the modularity of the code.
(case (:inspector @state)
:schematic [:div#inspector-column
[component-list]
[inspector]]
:simulator [:div#inspector-column
[simulation-panel]])When setting up the modal dialog in the simulation-panel component hot realod did not work as expected...
Defining the modal dialog right before or after the case statement fixes the update problem. It is not related to hot reload and has probably nothing to to with shadow-cljs.
Or maybe it is some combination of hot-reaload and relagent.