This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-08-18
Channels
- # announcements (17)
- # babashka (42)
- # beginners (34)
- # calva (78)
- # cherry (1)
- # cider (7)
- # clojure (64)
- # clojure-europe (19)
- # clojure-nl (2)
- # clojure-norway (54)
- # clojure-uk (3)
- # clojurescript (21)
- # cloverage (1)
- # conjure (1)
- # core-async (11)
- # cryogen (16)
- # cursive (1)
- # data-oriented-programming (1)
- # datahike (5)
- # fulcro (2)
- # girouette (1)
- # helix (10)
- # hyperfiddle (1)
- # jobs (1)
- # kaocha (4)
- # nbb (7)
- # off-topic (6)
- # pathom (4)
- # polylith (21)
- # rdf (9)
- # releases (2)
- # shadow-cljs (3)
- # sql (12)
- # squint (68)
- # vim (33)
- # xtdb (29)
@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
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?
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))