meta_pixel
Tapesearch Logo
Log in
Syntax - Tasty Web Development Treats

Hasty Treat - Why should I use React Hooks?

Syntax - Tasty Web Development Treats

Wes Bos

Tech News, Technology, News

4.9 • 1.2K Ratings

🗓️ 7 December 2020

⏱️ 26 minutes

🧾️ Download transcript

Summary

In this Hasty Treat, Scott and Wes talk about React Hooks and why you might want to use them instead of class components. Sentry - Sponsor If you want to know what’s happening with your errors, track them with Sentry. Sentry is open-source error tracking that helps developers monitor and fix crashes in real time. Cut your time on error resolution from five hours to five minutes. It works with any language and integrates with dozens of other services. Syntax listeners can get two months for free by visiting Sentry.io and using the coupon code “tastytreat”. Show Notes 03:54 - Decouple the UI from the logic This wasn’t impossible with class-based components, but we started using HOC to do this. With hooks, it makes you decouple what it does and how it looks. Makes things like GraphQL code gen possible Multiple pieces of state or functionality Share commonly used functionality among projects and components 10:31 - Reduction in code Lifecycle methods were often redundant. useEffect offers a way to prevent the duplication that can happen with component did update and did mount. This gives you a way to say, “Hey, run this code when these things change.” 13:30 - useEffect’s dependencies These give you access to targeted control over side effects rather than just something changed. 14:15 - Easier to grok What happens? When? Where? It’s mostly in the hook. 16:09 - Simplicity in usage Thing, updateThing is more targeted than set state Ref makes way more sense with useRef String refs weren’t great, the function ref thing was obnoxious 21:07 - Gripes about Hooks Naming is kind of odd Vue did a better job with the names Links https://github.com/pmndrs/jotai https://github.com/rehooks https://twitter.com/youyuxi/status/1327328144525848577/photo/1 Tweet us your tasty treats! Scott’s Instagram LevelUpTutorials Instagram Wes’ Instagram Wes’ Twitter Wes’ Facebook Scott’s Twitter Make sure to include @SyntaxFM in your tweets

Transcript

Click on a timestamp to play from that location

0:00.0

Monday, Monday, Monday, Monday, open wide Dev fans.

0:04.0

Get ready to stuff your face with JavaScript,

0:07.0

CSS, node modules, barbecue tips, get workflows,

0:10.0

breakdancing, soft skills, web development,

0:12.0

the hastiest, the craziest, the craziest development the hastiest the craziest the tastiest web development treats coming in hot here is

0:18.1

Wes Barracuda bars and Scott El El Toro Loco, Tolinsky.

0:25.0

Welcome to Syntax.

0:28.0

In this hasty treat, we are going to be talking all about React Hook hooks and why you might want to use them

0:35.0

verse class components. What are the benefits over class components and

0:39.2

really what is the incentive to switch to function components versus class components.

0:44.0

My name is Scott Tolinsky.

0:45.0

I'm a developer from Denver, Colorado and with me as always is the West Boss.

0:49.0

Hey, I'm excited about this one.

0:50.7

We got to actually a potluck question that says what is the incentive to

0:53.8

switch to react hooks versus classes so we thought we'd turn that into a little

0:58.1

episode and explain why we liked them and why they were even made.

1:03.0

Yes, yes, and a side note, a meta note.

1:06.1

This is going to be funny for anybody who's maybe seen this tweet,

1:08.6

but I'm broadcasting live from Hamilton, Ontario,

1:11.3

and I believe West is in Denver, Colorado, because what we did is we took photos of our

1:16.0

background or screenshots of our backgrounds and then swapped them and we're using them as Zoom

1:21.1

backgrounds. So I have West's typical background at Wes.

...

Please login to see the full transcript.

Disclaimer: The podcast and artwork embedded on this page are from Wes Bos, and are the property of its owner and not affiliated with or endorsed by Tapesearch.

Generated transcripts are the property of Wes Bos and are distributed freely under the Fair Use doctrine. Transcripts generated by Tapesearch are not guaranteed to be accurate.

Copyright © Tapesearch 2026.