News for hackers. Stuff that matters.
Re:Making Sense of React Server Components by danielvaughn on Wednesday September 06, 2023 @02:46PM (#37409327)
I find it's mostly the kids who like hooks, and the older devs who've been around since jQuery or further back, who dislike them.
Re:Making Sense of React Server Components by tshaddox on Wednesday September 06, 2023 @02:55PM (#37409464)
For what it's worth, that's not at all my experience on the teams I've worked with. I was around when hooks were released and it was an immediate and significant improvement to our team at the time.
Re:Making Sense of React Server Components by Scarblac on Wednesday September 06, 2023 @03:57PM (#37410426)
I'm 49 and started with the Commodore 64, and function based components with hooks are so much cleaner than the old class based components, it's unbelievable.

The classes had closely related functionality spread out over several different methods making them hard to understand at a glance, function based components are very concise.

I think people who dislike hooks tend to overuse useEffect (it's rarely needed) and to do too much inside components rather than inside custom hooks.

Re:Making Sense of React Server Components by ng12 on Wednesday September 06, 2023 @04:18PM (#37410716)
My experiences with jQuery are literally the exact reason why I like React.

I strongly suspect most HNers who are overly critical of React (and/or general web framework complexity) have never had to write and then maintain a large web application in jQuery.

Re:Making Sense of React Server Components by holoduke on Wednesday September 06, 2023 @05:48PM (#37411853)
JQuery is just a hammer. Its not a framework. It does provide utilities like selectors, events, triggers, dom manipulation etc. React is a component based framework. It contains pages, routes, state management, caching etc. You cannot compare those two. In a way jQuery is low level just above vanilla. Wheras react has a minimum of 500 execution layers. Thats why its slow and painful in many cases.
Re:Making Sense of React Server Components by keb_ on Thursday September 07, 2023 @12:00AM (#37414606)
To be pedantic, React is a library, and doesn't provide page abstractions, routes, or state management outside useState and useReducer. It also doesn't have very strong opinions about how you structure your application (what a framework does). That's what Next.js is for.

I agree with your overall sentiment though.

Re:Making Sense of React Server Components by paulddraper on Thursday September 07, 2023 @09:35AM (#37418714)
> It contains pages, routes, state management, caching etc.

React does not have routes or caching. It has about as much management as jQuery.

Re:Making Sense of React Server Components by danielvaughn on Wednesday September 06, 2023 @06:23PM (#37412223)
Not talking about React, I’m talking about effects. Two very different things. I love React, I don’t love hooks or effects.

I don’t think application state belongs inside the rendering machine.