Fork me on GitHub
#helix
<
2020-11-13
>
tomc16:11:17

Have any helix users managed to implement a reliable hook for subscribing to re-frame subs? I've got one that seems to work well enough, but occasionally results in "Cannot update a component from inside the function body of a different component." warnings.

lilactown18:11:09

we use useSubscription and r/track, it works okay

đź‘Ť 3
lilactown18:11:29

we get a bunch of extra renders, but I've never seen "Cannot update a component from inside the function body of a different component."

Jimmy Miller19:11:53

So the readme says that fast-refresh should be installed https://github.com/lilactown/helix/blob/55cb707728418176ccc4aa364ae0f6faffc0c448/README.md#installation But the section on fast refresh says I need to install it. https://github.com/lilactown/helix/blob/55cb707728418176ccc4aa364ae0f6faffc0c448/docs/experiments.md#fast-refresh It seems like the readme is the most up to date one, but it seems the document on fast-refresh is correct. At least for my setup, if I try to require the refresh experimental namespace I get "No such namespace: react-refresh/runtime" Just wanted to see what the intended behavior was. Should refresh be included or not?

lilactown20:11:32

If your build tool follows deps.cljs (shadow-cljs does) it will automatically install it

lilactown20:11:47

However I have noticed that sometimes it doesn’t and I don’t know why lol

lilactown20:11:22

You’ll want to make sure that you have the correct version of react-refresh for the version of React you use.

lilactown20:11:27

If you are seeing errors around missing react-refresh/runtime then you’ll want to manually install it

đź‘Ť 3