React Hooks are dead and it's official! hooks have always been the traditional way of handling state and running side-effects in our React componen...
Some comments have been hidden by the post's author - find out more
For further actions, you may consider blocking this person and/or reporting abuse
We've had signals-like implementations in state management libs for react for quite some time, however these aren't real signals. The concept of signals was made popular by solidjs (signals is the backbone of solidjs) and got a lot of attention when angular adopted the same pattern. React cannot do real signals, because it needs to always traverse the entire component tree, which goes against the principles of signals. Signals implementations in React are just a facade that visually make it look like signals, but if you look at the source, you will see that they use some form of observer lib like rxjs to subscribe to state updates and then normal react useState hook, which will trigger a traversal of the entire component tree in the vdom.
Yes I agree with the part where you said they used RXJS under the hood. When I first checked signals out the first thing that came to my mind is no way React is doing this thing by default. Something else is happening under the hood.
I didn't know about signal like implementation in other state management libraries.
I'm pretty sure signals were already popular on linux development before solidJS came to exist
Hah, well we'll have to ask Ryan where he got the idea then :p
Official by whom? Can you please share a link to React (not Preact) documentation? I didn't even see a mention of signals in the official documentation.
If this article about Preact why I see React in the title and keywords?
Are you sure you took your time to read through the whole article?
I did read it, and also didn't find any confirmation of this bold claim. Only a link to your YouTube channel.
Oh I see where the confusion is, well I actually attended the funeral where we laid Hooks to rest.
Anyway if you did read the full article then you'd see where I stated "Personally in my humble opinion signals will replace some hooks but not all hooks".
The goal of this post at the end the day is not to prove that React hooks are dead rather it is to introduce the concept of signals in a friendly way.
I know you don't want them to take hooks away yes we all love using hooks but if there's something that gets the job done more easier than hooks I don't know about you but I'll definitely go for it.
There is no confusion, you just use a false claim, and that’s it.
To clear confusion I think @usulpro is referring to your use of "official" included in your claims with no "official" announcement anywhere. I've read the entire article and it changed nothing.
Signals is the reason I started using SolidJS instead of React. The only downside was not being able to take advantage of the huge React ecosystem. I will have to give these a try. Thanks for the article.
You're welcome. Now React has it's own implementation of signals hopefully you can start using React.
Hey @kalashin1, do you mean Preact?
No, I meant for React. However the signal Library was built by Preact.
Can you link the documentation here?
Here's the link to the documentation
React and Preact are different libraries man!
Please make it clear that "React doesn't have it's own implementation of signals yet"
Interesting and I'm not against the idea of signals but I honestly can't see the advantage of signals over hooks at this point. Feels like we're (once again) reinventing the wheel.
Also you basically get this out-of-the-box with Vue, the entire render engine is based around this sort of concept.
We are always moving back and forth in the world web app development.
I hate to be that guy, but if React hooks were dead why do approximately 99% of React apps (past, present, and foreseeable future) still use them?
Because it's what developers are used to and hey hooks still help us get the job done.
So... they're not dead? 😂
not totally 😂
Hold on... are you trying to say that React will finally be... reactive? It only took 10 years for the name not to be ironic
😂 everything isn't the way it always seem.
Hey @kalashin1 really nice post.
Can you create a similar for Angular as well? We've got signals over there as well. 😂
It's been really long since I used Angular but hey I'm going to try my best.
fdsfds
How can i update the signal , is it just a like updating the object value using the key ?
totally.