Live data from Hacker News

React Still Feels Insane and No One Is Talking About It

mbrizic.com

31–40 of 41 posts

Re: React Still Feels Insane and No One Is Talking About It

#31
post #28

This article makes ME feel like I'm going insane. Have you even read the React docs? The article you linked about "patterns" in React is explicitly referencing patterns that are 7+ years out of date. Hooks were built to REPLACE those patterns, and they did a phenomenal job. 90% of this article is immediately invalidated by introducing a simple, 20loc "useQuery" hook (or, god forbid, looking at ANY of the libraries th…

I agree about that specific patterns post being a bad example... but if you google for "react patterns" you won't be starved for examples of more terrible drivel. That's just what's out there, people repeat it ad nauseam. So _good luck_ to anyone who really does want to learn the right thing. From that standpoint, that article is as good or bad as most others out there (old man shakes fist at dev.to).

Even the venerable libraries like useQuery introduce as many surprises as they do benefits. The complexity cost of understanding what is going on under those 20 LOC is quite high – you need to understand "stable values" (which is only relevant to React components), re-renders and how they're triggered, maybe need to understand how graphql fragments are collated into one query document... maybe need to know when useRef is the right way to memoize over useMemo.

I agree with the author, that it feels insane. I would even add to the insanity the lack of quality when searching for help, and the weird rabbit holes that GPT can send you down if you don't already know what "good" looks like.

Re: React Still Feels Insane and No One Is Talking About It

#32

Coming from Angular, too, I never really liked React. Angular had dependency injection and that made things so nice to work with. React ended up with Redux and then contexts, which imo are both hacks in reaction to realising who in the fuck wants to pass down a singleton service component which maintains say a db connection down from the root of the project through all the damn layers of the app. Define it at root, u…

Context is pretty much DI, but it works with the component tree - I can wrap different subtrees in different providers. This is much more powerful than angular style dependency injection and there have been several times where I was really grateful for it.

Re: React Still Feels Insane and No One Is Talking About It

#33
post #28

This article makes ME feel like I'm going insane. Have you even read the React docs? The article you linked about "patterns" in React is explicitly referencing patterns that are 7+ years out of date. Hooks were built to REPLACE those patterns, and they did a phenomenal job. 90% of this article is immediately invalidated by introducing a simple, 20loc "useQuery" hook (or, god forbid, looking at ANY of the libraries th…

When I saw the setState in useEffect, I immediately knew why the person hates react. That's a horrible antipattern used by people who refuse to read the few articles about useEffect and when to use it.

Re: React Still Feels Insane and No One Is Talking About It

#34
So, if I were to try to convince you just how wrong you are, what I would do is start with a React project that uses React-Router v7 with the data routers, including the `loader`. That one thing alone, even above and beyond what others are saying about React Query, just blows the whole complexity of API communication out of the water.

And then, if you are doing anything full stack or have a middleware/backend-for-frontend, for god's sake, look into tRPC and let your mind be blown.

Putting these two together, in a simple vite project (no full stack "framework" needed"), it will seriously just change the way you look at data, loading, and API interactions.

It just feels somewhat like the OP's problems with React are all skill issues and a lack of desire to explore and learn correctly.

Re: React Still Feels Insane and No One Is Talking About It

#35
This article reads as:

"I'm an incompetent frontend developer and don't know how to use React, so I just think project managers should not give tasks that make me do hard things because I just don't know how to do it... probably React's fault cause I'm perfect"

Author is just plain bad lol

Re: React Still Feels Insane and No One Is Talking About It

#36

So, if I were to try to convince you just how wrong you are, what I would do is start with a React project that uses React-Router v7 with the data routers, including the `loader`. That one thing alone, even above and beyond what others are saying about React Query, just blows the whole complexity of API communication out of the water. And then, if you are doing anything full stack or have a middleware/backend-for-fro…

I don't know, he made a great point about `useEffect` and its data flow and composability problem, which I've known for some time. The part about top down state being one giant mutable variable is true, but it's also how functional programming languages do it with a state-monad-esque runtime, like Elm. It's mostly a footgun when you're irresponsible cutting across many redux state machines in a single component.

I think the author is kind of a mediocre frontend eng but it's also true that modern react + hooks are full of footguns that can get very ugly. It's the opposite outcome of what react was originally designed for, to make it easy to do the right thing.

Re: React Still Feels Insane and No One Is Talking About It

#37

You can make a perfectly effective UI in vanilla HTML5 and it will work forever, just like you can roll up for your date wearing practical clothes driving a 2002 Honda Civic, but you’re not guaranteed to look impressive enough to snare the targets. I think the point of all this JavaScript library evolution is not to be a good coder or a practical husband.

HTML5 as in no JS? So full page loads after every click?

View transition API helps mitigate this.

But datastar (they just released v1 2 days ago) is even better.

MPA, server-rendered, but with client-side reactivity pushed from the server via SSE.

It's pretty impressive - better than HTMX imho.

Re: React Still Feels Insane and No One Is Talking About It

#38
post #23
post #17

I would be interested in seeing a legit back and forth between this view and alternatives. Advocates of react, in particular, would be a good read after this.

The failure of every new solution seems to always come back to the fact that html, css, and js are just too poorly suited for building the complex UIs people want today. And the sad reality is that there isn't an engineer out there building these things that has any agency to come up with an alternative. It would take Google, Apple, and Microsoft coming together to define a new system of building as an alternative. T…

You're right.

It was solved with Silverlight - declarative UIs in XAML. No CSS. Strongly typed C#. The downside was you needed to install the plugin.

So there are better ways than HTML/CSS/JS but we're stuck with them, because they are browser-native. WASM might rescue us!

I've at least managed to almost completely get rid of JS/SPA framework madness in the browser by going back to server rendered pages (adding reactivity where needed with datastar signals). Datastar is a breath of fresh air and might just make all SPA frameworks obsolete (just as they in turn killed jQuery).

Re: React Still Feels Insane and No One Is Talking About It

#40
Both React and Angular are poorly designed frameworks that require writing a fragile boiler plate. Try $mol - it is strikingly different from these two for the better. It continues the jQuery philosophy (write little, do a lot), but is optimized for creating truly large, but architecturally simple projects. There are many high-tech articles in the encyclopedia on the framework's website. For example, an article about React problems: https://mol.hyoo.ru/#!section=docs/=lre14i_zd4xlz
Post reply on HN