Skip to content

Commit

Permalink
This should fast-refresh components, if my understanding is correct
Browse files Browse the repository at this point in the history
- And it doesn't seem to work.
  • Loading branch information
danieroux committed Mar 6, 2020
1 parent 02bfd99 commit 4dfa5e6
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion dev/fast_refresh_example.cljs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
(ns fast-refresh-example
(:require [helix.core :as hx :refer [<> defnc $]]
[helix.dom :as d]
[helix.experimental.refresh :as refresh]
[helix.hooks :as hooks]
["react-dom" :as rdom]))

Expand All @@ -26,8 +27,13 @@
1000))


(defn ^:dev/after-load after-load []
(refresh/refresh!))


(defnc app
[]
{:helix/features {:fast-refresh true}}
(let [[name set-name] (hooks/use-state "Lisa")
[date set-date] (hooks/use-state (js/Date.now))]

Expand All @@ -54,4 +60,6 @@
(defn ^:export start []
(rdom/render
($ app)
(js/document.getElementById "app")))
(js/document.getElementById "app"))
(js/console.log "Injecting Refresh Hook")
(refresh/inject-hook!))

0 comments on commit 4dfa5e6

Please sign in to comment.