4 ms·
That's backwards. React is a tool for writing declarative UI (or declarative anything really) that can handle state updates. Probably they're using it because i
by ajkjk 2y ago
That's backwards. React is a tool for writing declarative UI (or declarative anything really) that can handle state updates. Probably they're using it because it's the best tool around for that job.
- afiori 2y agoReact manages the state of the UI, all the props and the virtual DOM counts as state. The declarative part is that the UI is recomputed from the state sorta-ex-novo at each update
- ajkjk 2y agoSure but the essence of it, the reason that it works, is that it shims a declarative architecture into JS. It works because it turns out UI programming works better in a declarative style.The fact that that involves managing state is secondary. I expect that in fifty years all programming will look declarative, either like HTML (which is sorta 'natively declarative') or more like React (which shims it into an imperative language).
- afiori 2y agoState management is not secondary, it is how it can implement the declarative UI with declarative updates.
- ajkjk 2y agoThat is a silly way to phrase it. It's secondary in the sense that of course a UI framework has to manage state. They all do that if they're complex at all. The state management is not what distinguishes React from other frameworks; it is distinguished by the (pseudo-)declarative API that it presents to the programmer.
- DonHopkins 2y agoNew Shimmer is a Floor Wax AND a Desert Topping! https://www.tiktok.com/@user2571420815968/video/7205011129590926634?lang=en https://www.tiktok.com/@user2571420815968/video/720501112959... But both the JavaScript and Lua versions of React are full of high fructose corn syrup, anyway. https://www.youtube.com/watch?v=H_zsZMn5Efk https://www.youtube.com/watch?v=H_zsZMn5Efk I'd prefer a low-calorie high-performance port of Svelte to Lua. https://www.youtube.com/watch?v=T6EVgwMfzb0 https://www.youtube.com/watch?v=T6EVgwMfzb0
- hipadev23 2y agowhen htmx.lua
- Uehreka 2y agoThat parenthetical “or anything declarative really” is doing a lot of work, given that: React is a tool for writing 3D scenes that can handle state updates: https://github.com/pmndrs/react-three-fiber https://github.com/pmndrs/react-three-fiber React is a tool for writing music that can handle state updates: https://github.com/FormidableLabs/react-music https://github.com/FormidableLabs/react-music React is a tool for writing infrastructure-as-code templates that… um… could with some additional work handle state updates: https://www.linkedin.com/pulse/aws-terraform-generator-using-react-from-nitesh-bhat--3phpc https://www.linkedin.com/pulse/aws-terraform-generator-using...
- ajkjk 2y agoWell it depends if you're talking about React the UI library or React the increasingly popular underlying architecture. The former is vastly more popular by usage (I mean.. I assume) but the underlying approach to declarative-in-imperative turns out to work in other settings and seems to be gaining traction.