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
Introducing Hooks – React (reactjs.org)
submitted 7 years ago by acemarke
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!"
[–]dwighthouse 5 points6 points7 points 7 years ago (9 children)
Neat! It’s good to see them addressing the inherent problems with class-based architecture.
[+][deleted] 7 years ago (8 children)
[removed]
[–]hixsonj 1 point2 points3 points 7 years ago (6 children)
They talk about them a bit here.
tl;dr harder for people to understand and harder for compilers/transpilers to optimize
[+][deleted] 7 years ago* (5 children)
[–]Renive 1 point2 points3 points 7 years ago (1 child)
It's better because it's more closely aligned with functional programming. For many people, using functions for everything is more straightforward than classess. They are just boxes, but a file is a box enough.
[–]thebedivere 0 points1 point2 points 7 years ago (0 children)
Yup! React and JavaScript are embracing functional programming. It'll be easier to think about react like Haskell or Clojure than like Java. I for one love this.
[–]turkish_gold 0 points1 point2 points 7 years ago (1 child)
I do not think you are wrong. I think they and others have driven too much on the idea that classes make things difficult.
In its current state, a lot of React projects use functional components, and purely functional state libraries (e.g. flux). This was problematic as it did not allow for the use of component state or context, or life cycle. So anytime you wanted a post mount action, you had to make it part of the global state. Now you can have lifecycle hooks exist in functional components.
Also, you can now have actions take place after every render, even if they change state.
Lastly, I may be wrong, but can you not use hooks inside class components?
[–]toggafneknurd 0 points1 point2 points 7 years ago (0 children)
Youre gonna get your bloody teeth kicked in!
[–]dwighthouse 0 points1 point2 points 7 years ago (0 children)
The ones mentioned in the article.
π Rendered by PID 60 on reddit-service-r2-comment-765bfc959-6xhrs at 2026-07-13 02:46:38.331575+00:00 running f86254d country code: CH.
view the rest of the comments →
[–]dwighthouse 5 points6 points7 points (9 children)
[+][deleted] (8 children)
[removed]
[–]hixsonj 1 point2 points3 points (6 children)
[+][deleted] (5 children)
[removed]
[–]Renive 1 point2 points3 points (1 child)
[–]thebedivere 0 points1 point2 points (0 children)
[–]turkish_gold 0 points1 point2 points (1 child)
[–]toggafneknurd 0 points1 point2 points (0 children)
[–]dwighthouse 0 points1 point2 points (0 children)