Fork me on GitHub

hx version 0.4.0 has been released! This is a major change and has a number of improvements: - Local state hook <-state now returns a tuple [value set-value] instead of an atom-like value - The hiccup parser hx.hiccup has been completely decoupled from React and made cross-platform - DX improvements like prettier display names and helper syntax for using higher-order components - Numerous bug fixes - Lots of tests Check out the full changelog here: Thanks to @orestis @mhuebert @roman01la @djebbz for the help! More to come soon 😄

🎉 36

Cool! This looks interesting. What's the value proposition for using hooks in cljs?


The promise that when concurrent React lands, you will get it “for free”, including prioritizing and canceling renders. Whereas with the current CLJS approaches (and with most/all other JS state management frameworks, to be fair) React doesn’t have the context to be nimble about updates.

👍 4

At the same time, hx takes an opinionated approach of using plain React components everywhere. So you could in theory hook it up with existing state management solutions.


It’s early days, hooks look very promising but I expect things will be more stable and production ready in a few months time.


Oh, forgot to mention - hooks allow you to do almost everything that class components provide (all the lifecycle methods) from functional components - in a way that’s actually reusable. So that’s a huge plus in my book.