How Do React Hooks Actually Work? React.js Deep Dive #3

Published: 20 June 2021
on channel: Philip Fabianek
30,705
1.1k

In this video, we will learn how React Hooks actually work. We will do that by answering a number of questions about React Hooks. The first and most important question is Why do hooks rely on call order? (in other words Why can't they be called inside loops or conditions?). This has a lot to do with the fact that hooks are all about arrays and indexes. We will show this by reverse-engineering two of the most used React Hooks: useState and useEffect. The next question is Why isn't X a hook? The X in the question can be any hook proposition you can think of and the reason is that all React Hooks strictly follow 2 very important rules: composition and debugging. The last question we will answer is How does useState communicate with the renderer?

Timestamps:

0:00 Introduction
0:38 Why do React Hooks rely on call order?
0:53 Reverse-engineering useState hook
6:40 Reverse-engineering useEffect hook
10:42 Why isn't X a hook? (composition and debugging)
11:30 useBailout
12:59 How can useState be a part of rendering?

Social Media:

►Twitter:   / philip_fabianek  
►LinkedIn:   / philip-fabianek  
►Website: http://www.philipfabianek.com
►GitHub: https://github.com/philipfabianek

Music:

Lodhi by Pali Gap   / pali_gap​  
Creative Commons — Attribution 3.0 Unported — CC BY 3.0
Free Download / Stream: https://bit.ly/lodhi-pali-gap​
Music promoted by Audio Library    • Lodhi – Pali Gap (No Copyright Music)  ​

Lights Of Elysium - AERØHEAD   / aerohead​  
Creative Commons — Attribution-ShareAlike 3.0 Unported — CC BY-SA 3.0
Free Download / Stream: https://bit.ly/lights-of-elysium​
Music promoted by Audio Library    • Lights Of Elysium – AERØHEAD (No Copy...  

Solace by Nomyn   / nomyn​  
Creative Commons — Attribution 3.0 Unported — CC BY 3.0
Free Download / Stream: http://bit.ly/SolaceNomyn​
Music promoted by Audio Library    • Solace – Nomyn (No Copyright Music)  ​

#ReactJS #ReactHooks #ReactDeepDive


On this page of the site you can watch the video online How Do React Hooks Actually Work? React.js Deep Dive #3 with a duration of hours minute second in good quality, which was uploaded by the user Philip Fabianek 20 June 2021, share the link with friends and acquaintances, this video has already been watched 30,705 times on youtube and it was liked by 1.1 thousand viewers. Enjoy your viewing!