@lilactown as long as I have you, I’m quite new to clojurescript development and am curious if I should expect that reloading toplevel definitions in the REPL should change content on the page dynamically
you have to set that up. are you using the fast refresh feature of helix?
I’m trying to but not sure how to verify. I’m a bit confused by how that works. Does that retain state across refreshes or across redefinitions?
oh I missed this lib.cljc guy that seems to do some redefinition of defnc
I was wondering how this component flag gets injected.
yeah, it's kind of awkward rn. you have to define your own defnc macro
react-refresh ought to refresh all of the components in the namespace you change, and retain any state unless you've changed the hooks used inside it
if you don't care for it, you can always do this:
(ns my-app.core
(:require
["react-dom" :as rdom]
[helix.core :refer [$ defnc])
(defnc my-app
[]
"hello")
(def root (rdom/createRoot (js/document.getElementById "app"))
(defn ^:dev/after-load start!
[]
(.render root ($ my-app))react 18 syntax above. if you're using react 17 or earlier, you can just call rdom/render in start!
just released helix 0.1.8 with the fix for that infinite loop