Re:Luminus – A Clojure Web Framework
by blain_the_train on Tuesday April 14, 2020 @09:30AM
(#22865671)
Reagent and rum both wrap react right? Do they mirror the react hook logic in some way? E.g rum/react might be a ones to one with reacts use state hook.
Yes, Reagent and Rum are both wrappers around React.
I think React hooks arrived much later and from what I've read about them, they solve a problem that does not exist in Clojure/ClojureScript.
`rum/react` lets your components auto-update when an atom changes.
I found Rum (https://github.com/tonsky/rum) to be a much more flexible choice. It doesn't force you into a single way of doing things, but rather offers a composable way of adding behavior to components using mixins. Especially for larger and more complex applications this proves to be a good tool.
Another thing which I really like about Rum is "isomorphic rendering" (not a good name, but I didn't invent it) — pre-rendering the DOM on the server instead of shipping an empty page to the client and requiring the client to render everything using JavaScript.