Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
How Hooks Work under the Hood?
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
miycctwn
August 25, 2020
Programming
39
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
How Hooks Work under the Hood?
公司內部 React workshop 分享
miycctwn
August 25, 2020
More Decks by miycctwn
See All by miycctwn
自己的工具自己造,咱們來造 React Hooks!
mindytai
0
78
Other Decks in Programming
See All in Programming
S3 TablesのIcebergデータに、AIエージェントからアクセスしてみた / 20261016developersio2026joetsu-accessing-iceberg-in-s3tables-via-agent
kasacchiful
PRO
0
150
全ての永続トークンを、生まれる前に消し去りたい!
sylph01
2
880
外から家のPCの電源入れたい!をPHPで解決する
kawashimo0
1
130
AIに “答え“を書かせるのを やめてみた
___akari11
0
120
月間100万人のサービス刷新で、 技術選定をHonoに振り切った話
yutobara
8
6.6k
Compiling a real-world CLI tool to native with Static Hermes
tmikov2023
0
120
UnityでSystem.Net.WebSocketsなWebSocketサーバが動かないのでUnity Monoのコードを覗いてみた / about implementing websocket server with unity mono
drumath2237
1
610
PumaからFalconに移行したRailsアプリケーションでの実践
falcon8823
0
170
FactoryBotをやめればRSpecは速くなるのか?
yuta_onishi_97
0
290
R8 の設定見直しでアプリサイズ削減
andpad
0
220
パズルゲームの作り方 / how to make puzzle games
kaityo256
PRO
2
290
Atomic Design, Enforced: Scaling Mobile Design Systems (next.app devCon / droidCon Berlin 2026)
steliosf
PRO
0
170
Featured
See All Featured
Designing Dashboards & Data Visualisations in Web Apps
destraynor
232
55k
Lessons Learnt from Crawling 1000+ Websites
charlesmeaden
PRO
1
1.6k
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
330
How to build a perfect <img>
jonoalderson
1
6.1k
Ten Tips & Tricks for a 🌱 transition
stuffmc
1
270
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
11
1.1k
How to Align SEO within the Product Triangle To Get Buy-In & Support - #RIMC
aleyda
2
1.8k
Exploring anti-patterns in Rails
aemeredith
4
540
How to train your dragon (web standard)
notwaldorf
96
6.9k
The agentic SEO stack - context over prompts
schlessera
0
970
A designer walks into a library…
pauljervisheath
211
25k
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
730
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)