React Today and Tomorrow and 90% Cleaner React With Hooks
React Conf4 HN recommenders · recommended in 4 months, 2019–2025
talk · intermediate · 2019–2025 on HN
The first three talks from React Conf 2018, by Sophie Alpert, Dan Abramov and Ryan Florence. They introduce React Hooks and explain the problems with classes that hooks solve.
It is the canonical introduction to hooks, given by the people who built them, and HN uses it to answer questions about why hooks exist.
Up next
1 mo on HNThe Unbeatable Game from the 60s: Dr NIM
Stand-up Maths
1 HN recommend · 2016–2023
3 mo on HNWhat a Japanese Moving Company in Tokyo is like
Paolo fromTOKYO
3 HN recommender · 2020–2025
1 mo on HNThe Lighthill debate on Artificial Intelligence: "The general purpose robot is a mirage"
Pierre-Yves Oudeyer
1 HN recommend · 2019–2025
3 mo on HNFluorine - Periodic Table of Videos
Periodic Videos
4 HN recommender · 2015–2021
5 mo on HNIrving Finkel | The Ark Before Noah: A Great Adventure
The Institute for the Study of Ancient Cultures
4 HN recommender · 2021–2025
9 mo on HNModern Dictionaries by Raymond Hettinger
SF Python
9 HN recommender · 2016–2025
2 mo on HNThe Lighthill Debate (1973) - part 1 of 6
bilkable
2 HN recommender · 2016–2021
2 mo on HNSurreal Numbers (writing the first book) - Numberphile
Numberphile
3 HN recommender · 2016–2022
14 mo on HNWhat the heck is the event loop anyway? | Philip Roberts | JSConf EU
JSConf
16 HN recommender · 2015–2025
13 mo on HNRich Harris - Rethinking reactivity
You Gotta Love Frontend
15 HN recommender · 2019–2026
10 mo on HNCrockford on JavaScript - Volume 1: The Early Years
YUI Library
10 HN recommender · 2013–2022
10 mo on HNRailsConf 2016 - Turbolinks 5: I Can’t Believe It’s Not Native! by Sam Stephenson
Confreaks
6 HN recommender · 2017–2020
5 comments from Hacker News
Have you seen the ReactConf talk on hooks? [1] It's absolutely worth the watch, even if you're somewhat familiar with hooks. They go through the pitfalls of class-based components and how hooks solve them. It more-or-less boils down to: 1. class-based components force your lifecycle logic to live in disparate locations. 2. Class-based hooks are obtuse with hidden gotchas whereas pure functions tell you exactly what they're doing. 3. A whole class of unergenomic solutions disappears when you use hooks. [1] ▶ this video
Hooks require less boilerplate to set up and reuse stateful logic across components If you havent watched it yet, the talk that introduced hooks explains much better than I can: ▶ this video
Just watch the video from ReactConf 2018 where hooks are introduced (by the dude who built them). You can play along at home quite easily by getting started either with "npx create-react-app myApp" or a simple html file with one script tag to download react from a CDN and one script tag for your code. Talk: ▶ this video By the end of the talk you'll probably be leaning towards "this sounds cool, I'd like to play around with it" or "that sounds like cursed incantations for the damned".
You aren’t the only person, I’ve certainly heard it before. But I’m yet to hear a convincing rebuttal to Mixins Considered Harmful [1], the hooks talk [2] or the Motivation section [3] on the announcement. The arguments I’ve heard is that it is “cleaner”, “more understandable” or the OO style is preferred. Some developers feel uncomfortable with hook magic because it introduces a more niche programming concept than OO (e.g stateful functions). I don’t find these arguments compelling. What the React team managed to do was reproduce the same functionality as class components while decreasing the footguns associated with them. 1. link 2. ▶ this video 3. link
While you wouldn't want to leave "console.log" in your code in production, you can use them in function components just like a classes' render methods. A better example (from the video "React Today and Tomorrow and 90% Cleaner React With Hooks" from October[1]) is something along the lines of updating document.title = `${some} Page` or possibly calling an API. [1]: ▶ this video