Doing a port of our small-ish hx
app to helix: What would the corresponding hx.hooks.alpha/useStateOnce
be? Or do I need to reimplement it?
And similarly for useValue
?
both of them you can copy + paste into your project if you’d like. I did not include them in helix
useStateOnce
was something I thought would be useful for hot reloading, but it also changed the behavior of your app. the better option, if you want persistence across reloads, is to use React Fast Refresh
if you do want that state to persist across mounts, you should probably use React Context for it instead