Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
How Hooks Work under the Hood?
Search
miycctwn
August 25, 2020
Programming
0
35
How Hooks Work under the Hood?
公司內部 React workshop 分享
miycctwn
August 25, 2020
Tweet
Share
More Decks by miycctwn
See All by miycctwn
自己的工具自己造,咱們來造 React Hooks!
mindytai
0
58
Other Decks in Programming
See All in Programming
Rust 製のコードエディタ “Zed” を使ってみた
nearme_tech
PRO
0
190
そのAIレビュー、レビューしてますか? / Are you reviewing those AI reviews?
rkaga
6
4.6k
AIフル活用時代だからこそ学んでおきたい働き方の心得
shinoyu
0
140
AIと一緒にレガシーに向き合ってみた
nyafunta9858
0
250
余白を設計しフロントエンド開発を 加速させる
tsukuha
7
2.1k
AIで開発はどれくらい加速したのか?AIエージェントによるコード生成を、現場の評価と研究開発の評価の両面からdeep diveしてみる
daisuketakeda
1
2.5k
Grafana:建立系統全知視角的捷徑
blueswen
0
330
[KNOTS 2026登壇資料]AIで拡張‧交差する プロダクト開発のプロセス および携わるメンバーの役割
hisatake
0
290
「ブロックテーマでは再現できない」は本当か?
inc2734
0
1k
疑似コードによるプロンプト記述、どのくらい正確に実行される?
kokuyouwind
0
390
AIエージェントのキホンから学ぶ「エージェンティックコーディング」実践入門
masahiro_nishimi
5
470
AIによる開発の民主化を支える コンテキスト管理のこれまでとこれから
mulyu
3
370
Featured
See All Featured
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
38
2.7k
Product Roadmaps are Hard
iamctodd
PRO
55
12k
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
150
[RailsConf 2023] Rails as a piece of cake
palkan
59
6.3k
Raft: Consensus for Rubyists
vanstee
141
7.3k
The Mindset for Success: Future Career Progression
greggifford
PRO
0
240
Building Flexible Design Systems
yeseniaperezcruz
330
40k
My Coaching Mixtape
mlcsv
0
48
Thoughts on Productivity
jonyablonski
74
5k
Agile that works and the tools we love
rasmusluckow
331
21k
Abbi's Birthday
coloredviolet
1
4.8k
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
2
420
Transcript
How Hooks Work under the Hood?
01 JS Closure
Scope Chain 切分變數最有效範圍是 function
試看以下程式碼
None
內層的 function 可以讀取外層宣告的變數 但外層的 outer function 存取不到內層變數 若是自己層級找不到會一層一層往外找 直到 Global
None
function 是被定義的當下決定的 並不是被呼叫才被定義
Closure 當 inner function 被回傳後 可以取得內部函式環境裡的變數值 記住了當時的環境 這就是閉包!
0 2 useState
None
如果要更貼近真實的 React Hook API state 必須要為變數
None
Module Pattern Javascript Design Pattern
None
Ref 1. Deep dive: How do React hooks really work?
2. 0 陷阱!0 誤解!8 天重新認識 JavaScript!- 許國政 (Kuro)