React Tutorial - How Do React Hooks Actually Work?

Pubblicato il: 18 gennaio 2023
sul canale di: Cloud Guru
110
10

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?

#ReactJS #ReactHooks #ReactDeepDive


In questa pagina del sito puoi guardare il video online React Tutorial - How Do React Hooks Actually Work? della durata di ore minuti seconda in buona qualità , che l'utente ha caricato Cloud Guru 18 gennaio 2023, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 110 volte e gli è piaciuto 10 spettatori. Buona visione!