Closed danieroux closed 4 years ago
Hey @danieroux. I've updated the refresh example to be in line with the latest helix API.
Your PR is relatively correct. The biggest problem I ran into was a mismatch between react-refresh
and react
.
I'm not sure which react-refresh
version maps to which react
version, but I had to forcefully install react-refresh@latest
in helix in order to pick up the correct version, as well as clear out node_modules
and my shadow-cljs build cache.
Thank you, this now works for me too.
This may very well be out of the realm of helix
, and a react-refresh
issue:
(hooks/use-effect :once ,,,)
runs on every (refresh/refresh!)
. In the demo the js/setInterval
gets called on every refresh.
Which is different from running :once
:-)
According to react-refresh's tests, this is expected behavior:
That's quite surprising behavior. Thank you for finding it.
This is where they lose me: https://github.com/facebook/react/blob/235a6c4af67e3e1fbfab7088c857265e0c95b81f/packages/react-refresh/src/__tests__/ReactFresh-test.js#L2344
Hi Will,
I've tried to put together a fast-refresh example that works, so that I can replicate it in my code.
I cannot get it to work. What am I missing?
My expectation: