Fork me on GitHub
#helix
<
2022-05-11
>
ianchow08:05:33

Hi, I've read that #js tagged literal breaking fast refresh issue had been fixed but I'm still getting this problem.

(hooks/use-effect []
                  #js {:yo "sup"} ; breaks fast refresh
                  (clj->js {:yo "sup"}) ;ok
                  )

lilactown16:05:18

how does it break fast refresh?

ianchow03:05:05

(defnc test-page [_]
  (let [[state set-state] (hooks/use-state 0)]
    (hooks/use-effect :once
                      ;#js {:hi "hi"}
                      (clj->js {:hi "hi"})
                      (println "hi"))

    (d/div
     (d/a state)
     (d/button {:on-click #(set-state inc)} "Click me"))))
if i uncomment the #js line then "state" no longer persists when i save the file and shadow-cljs reloads.

lilactown16:06:57

I've fixed this in master

lilactown16:06:03

thanks for the report!