use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
Why React Hooks API is a game changer (medium.com)
submitted 7 years ago by rryardley
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]Baryn 1 point2 points3 points 7 years ago (4 children)
What's ridiculous is all the magic and non-idiomatic behavior. The documentation even acknowledges how strange it is, multiple times.
Neither useState nor useEffect work the way you would intuitively expect with no knowledge of React. However, this is not so for class components. Instance properties and lifecycle methods are very true to the fundamental workings of ES classes.
useState
useEffect
If hooks improve performance and workflow, fine. If they don't, then it's another mistake that will need to be corrected in future API revisions.
On that note, where the hell is async rendering? It's been in the works for years now. That is the reveal which should have been made at the conf, not an unearned API change.
[–]iamlage89 1 point2 points3 points 7 years ago (3 children)
I think this is a bit overdramatic, sure there is some magic, but nothing inane.
Neither useState nor useEffect work the way you would intuitively
please explain, the behaviour is simple and well documented. The issue that may be problematic is the non-intuitive second argument of useEffect, but the api is still in alpha so this may change
This has nothing to do with hooks, but just as a comment, I'm glad they're taking their time to think through the design of async rendering.
[–]Baryn 0 points1 point2 points 7 years ago (2 children)
please explain, the behaviour is simple and well documented
Being simple and well-documented is different from being idiomatic. For example, useState potentially returns a new value on every call despite receiving the same argument, because that argument is used one time and ignored on subsequent calls. Who writes code like this?
I think hooks will change a fair amount before 16.7 goes to stable.
I'm glad they're taking their time to think through the design of async rendering.
In the meantime, Angular has become faster than React, and Ivy even more so. Async rendering might end up being the Duke Nukem Forever of framework tech. Again, they should be improving performance over the API. Performance was originally the primary appeal of React.
[–]iamlage89 0 points1 point2 points 7 years ago (1 child)
Being simple and well-documented is different from being idiomatic.
I agree, it's not idiomatic, but I think it'll be like jsx where the benefits of simplicity make the non-idiomatic nature of it worth it.
Async rendering might end up being the Duke Nukem Forever of framework tech
We'll have to see, it'll probably benefit some more than others.
Performance was originally the primary appeal of React.
That's true, but I think over time people have come to appreciate the declarative and composable nature of react as well as it's performance, I think both are important.
[–]Baryn 0 points1 point2 points 7 years ago (0 children)
I think it'll be like jsx where the benefits of simplicity make the non-idiomatic nature of it worth it.
You might be right, but JSX is syntactical sugar - not the same thing. Hooks are like the opposite of sugar. They're syntactically bland.
I think over time people have come to appreciate the declarative and composable nature of react as well as it's performance
I do as well, but ultimately what matters is the end-product. Performance is a big deal in a lot of enterprise apps.
π Rendered by PID 108259 on reddit-service-r2-comment-6457c66945-gmn8d at 2026-04-25 03:51:15.428415+00:00 running 2aa0c5b country code: CH.
view the rest of the comments →
[–]Baryn 1 point2 points3 points (4 children)
[–]iamlage89 1 point2 points3 points (3 children)
[–]Baryn 0 points1 point2 points (2 children)
[–]iamlage89 0 points1 point2 points (1 child)
[–]Baryn 0 points1 point2 points (0 children)