News for hackers. Stuff that matters.
Re:Making Sense of React Server Components by debaserab2 on Wednesday September 06, 2023 @04:10PM (#37410620)
In your estimation, what framework has best in class hooks?
Re:Making Sense of React Server Components by Gunax on Wednesday September 06, 2023 @06:03PM (#37412022)
Some alternatives are:

Vue3/composition API -- probably the simplest if you're coming from React. Definitely feels like it was inspired by hooks.

Svelte/store -- svelte has a term called 'hook' but it's unrelated. The equivalent would be Svelte's store.

The other frameworks use something called 'Signals' (Preact, Qwik, Solid, Elm and even Angular/backbone though I don't personally have in depth knowledge of all of these).

IMO, I would prefer Svelte if you are adventurous, or Vue if you like React but just want something like 'better React'.

Re:Making Sense of React Server Components by shirogane86x on Thursday September 07, 2023 @08:57AM (#37418243)
I mean, Svelte/store is something completely different though, isn't it? it's more akin to Jotai/Zustand/Redux and friends than it is to hooks. If you had to compare Svelte with React, the thing "closest" (while stretching that word very much) to hooks would be the `$` reactivity things Svelte does? Because if you want a state management solution, react has that as well (many, in fact). Just not built in, and a lot of them work really well