5 ms·
Indeed, this is simpler in ClojureScript world where all state is kept in a single place. It's harder to do the same for JavaScript React components that may ha
by danabramov 12y ago
Indeed, this is simpler in ClojureScript world where all state is kept in a single place. It's harder to do the same for JavaScript React components that may have local state, but as you see, it's perfectly possible.
Also, as far as I'm aware, ClojureScript hot reloading tools actually unmount the component. This may be OK because state is restored from one source, but it's not as nice-looking because DOM is thrown away on every update, and it flickers.
- coding4all 12y agoWhat? When's the last time you've used Chestnut? Do you have an example I could look at? I ask because it sounds like you're doing something that re-renders the entire application instead of the components that need to update.
- danabramov 12y agoI may be wrong but I don't think Chestnut will patch existing instances? And without patching, I imagine React will recognize new version as a different type and bail out of reconciliation. I didn't try it, just chatted with David on Twitter and that's what I thought. Maybe I got it wrong! Anyway, I'm looking forward to learning more about ClojureScript. A lot of exciting things coming from there.