React 19 Beta

DustinBrett | 54 points

Since the introduction of Hooks, I've been struggling with understanding React and React code. For context: UI development is not my full-time job (anymore), and I mostly do backend dev these days. I still read/write React once in a while, but I don't enjoy it anymore.

Here is what I am struggling with: I am not able to grasp the programming model with Hooks. I am not able to read the code easily, nor am I able to easily understand the interactions in the app. "easily" being the keyword here. I can understand what is happening if I put in the effort, but every time, it is a struggle. I switch between languages and platforms all the time, but react code is where I have to take a real pause to understand what is going on.

My suspicion is that this has to do mostly with the names of the Hooks, and how they are used in the code.

* Why are they named useState, useEffect etc? Are there better names if used will make it easier for me to read this code? Are there any other systems/languages (even in JS) where similar constructs are present? What are their names?

* If JSX is anyway getting compiled to JS, why do I have to still deal with strange looking useState and useEffect declarations? Is there a way to get cleaner syntax and make React code read like regular code?

This is mostly a cry for help, and not a criticism of React. I have used React in the past (several years ago, before Hooks) and I used to "get" React.

niyazpk | 13 days ago

Hidden amongst all those updates is the fact that React finally supports custom elements. Advocates of web components can finally just say "web components work in every framework" without adding any disclaimers about React [1].

[1] https://custom-elements-everywhere.com/

throwitaway1123 | 13 days ago

Wow. useOptimistic is seriously cool. These are all really great tools to eliminate more and more boilerplate. Can't wait to put it all into use.

Gotta say, I really love what the react team has been doing, sure it hasn't always been perfect, but it really feels like inching closer to a very smooth developer experience very time.

Justsignedup | 11 days ago

Some inconsistencies here, metadata is added via jsx but preloading resources is done by some magic functions. Are they not hooks? what are they? Why there need to be this other way to make side effects?

nsonha | 12 days ago

It's been a couple of years since I was into React. What's the state of React? Where is it headead now? Are we over the SPA thing and returning to the age old RoR way?

Alifatisk | 13 days ago

With the introduction of this "actions" stuff I have finally completed the last step to becoming the simpsons' meme "old man yells at <react>". As in, after using it since around 2016 I think I will be looking for something different.

darepublic | 12 days ago