Closed schmee closed 9 years ago
I spent a couple of hours trying to get Figwheel to work with my app, which didn't auto-reload even though everything looked just fine in the Figwheel logs and in the dev console. Then I stumbled upon https://github.com/reagent-project/reagent/issues/94. Replacing (r/force-update-all) with (core/init!) in https://github.com/reagent-project/reagent-template/blob/master/src/leiningen/new/reagent/env/dev/cljs/reagent/dev.cljs#L11 solved my problem.
(r/force-update-all)
(core/init!)
Since force-update-all doesn't re-render the root component and core/init! does, it seems to me that the latter is a safer default.
force-update-all
core/init!
The only issue there is that core/init! runs some initialization code as well such as hooking in browser navigation that should only be run once on page load.
I spent a couple of hours trying to get Figwheel to work with my app, which didn't auto-reload even though everything looked just fine in the Figwheel logs and in the dev console. Then I stumbled upon https://github.com/reagent-project/reagent/issues/94. Replacing
(r/force-update-all)
with(core/init!)
in https://github.com/reagent-project/reagent-template/blob/master/src/leiningen/new/reagent/env/dev/cljs/reagent/dev.cljs#L11 solved my problem.Since
force-update-all
doesn't re-render the root component andcore/init!
does, it seems to me that the latter is a safer default.