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
Visual Intro to Custom React Hooks
Search
Inky Collective
July 16, 2019
Technology
0
2.6k
Visual Intro to Custom React Hooks
Lightning talk @ Reactadelphia July 2019! melody.dev/custom-hooks
Inky Collective
July 16, 2019
Tweet
Share
More Decks by Inky Collective
See All by Inky Collective
Glowing Up... with Ponies!
pixely
0
60
lo-fi hip hop beats to npm install to!
pixely
0
2.8k
Web Development w/ IE6 (like it’s 2018!)
pixely
0
1.7k
Spooking Your Friends with Electron (BrooklynJS #59)
pixely
0
3.4k
Rebble.io by Peach Hack (#PonyDev @ BronyCon 2018)
pixely
0
170
Sweetie Bot, Part 3 by Cloud Hop (#PonyDev @ BronyCon 2018)
pixely
0
78
Pony Podcast Programming by Corpulent Brony (#PonyDev @ BronyCon 2018)
pixely
1
100
How Equestria Was Made: Building EFNW's Website by Pixely (Everfree Northwest 2018)
pixely
0
420
IRC: Why it Failed by Cadey (#PonyDev @ Everfree Northwest 2018)
pixely
0
89
Other Decks in Technology
See All in Technology
2025年夏 コーディングエージェントを統べる者
nwiizo
0
130
おやつは300円まで!の最適化を模索してみた
techtekt
PRO
0
290
ガチな登山用デバイスからこんにちは
halka
1
230
2025年になってもまだMySQLが好き
yoku0825
8
4.5k
職種の壁を溶かして開発サイクルを高速に回す~情報透明性と職種越境から考えるAIフレンドリーな職種間連携~
daitasu
0
140
テストを軸にした生き残り術
kworkdev
PRO
0
190
5分でカオスエンジニアリングを分かった気になろう
pandayumi
0
180
フルカイテン株式会社 エンジニア向け採用資料
fullkaiten
0
8.7k
La gouvernance territoriale des données grâce à la plateforme Terreze
bluehats
0
150
Skrub: machine-learning with dataframes
gaelvaroquaux
0
120
現場で効くClaude Code ─ 最新動向と企業導入
takaakikakei
1
200
Kiroと学ぶコンテキストエンジニアリング
oikon48
6
9.8k
Featured
See All Featured
The World Runs on Bad Software
bkeepers
PRO
70
11k
Reflections from 52 weeks, 52 projects
jeffersonlam
352
21k
4 Signs Your Business is Dying
shpigford
184
22k
Building Better People: How to give real-time feedback that sticks.
wjessup
368
19k
Context Engineering - Making Every Token Count
addyosmani
1
20
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
1.5k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
26
3k
Facilitating Awesome Meetings
lara
55
6.5k
Unsuck your backbone
ammeep
671
58k
How to Ace a Technical Interview
jacobian
279
23k
The Pragmatic Product Professional
lauravandoore
36
6.9k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
7
840
Transcript
Custom React Hooks! by Melody, 1x engineer ✨ Reactadelphia July
2019
hey hi, i’m melody! they/them { , , , }
melody.dev
Let’s talk hooks. “They let you use state and other
React features without writing a class.” —Dan Abramov
Say you have a blog:
Where can custom hooks be used? “where is stateful logic
involved?” “can this logic be reused?”
Where can custom hooks be used? <NavItem> <ReadIndicator> <ToggleTheme>
Where can custom hooks be used? history user preferences
Let’s make a hook! psst… they’re just functions! • it
has to start with `use` • you can use other hooks in them • notably, useState() and other custom hooks!
Hooks in action: useHistory() <NavItem> <ReadIndicator>
Hooks on the net! usehooks.com
useDarkMode() usehooks.com/useDarkMode
Hooks in action: useHistory() <NavItem> <ReadIndicator> useDarkMode() <Application> <ToggleTheme>
Hooks in action: useHistory() <NavItem> <ReadIndicator> useDarkMode() <Application> <ToggleTheme>
useYourImagination() Here are some helpful resources: • https://reactjs.org/docs/hooks-custom.html • https://usehooks.com
useThankYou() @pixelyunicorn @melody melody.dev/custom-hooks patreon.com/madebymelody SW-4207-5422-1528