Fork me on GitHub
#shadow-cljs
<
2024-08-05
>
Dileep Reddy P01:08:05

Hello, I had a question about how hot code reload works in shadow cljs. Do I have to add a dev:after-load hook to my mount-root function for the reload to trigger? I ask because I am trying to use react hooks and this would cause the local state variables to be reset on rerender.

thheller07:08:36

yes, you need a after-load hook to re-render your page

👍 1
thheller07:08:43

yes, react hook state is lost

👍 1
thheller07:08:06

helix experimented with supporting react fast refresh but I have no clue how that works, see https://github.com/lilactown/helix/blob/master/docs/experiments.md#fast-refresh

👍 1
Dileep Reddy P00:08:18

Thank you for the quick reply! I will look into helix I started with reagent