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
64
lo-fi hip hop beats to npm install to!
pixely
0
2.9k
Web Development w/ IE6 (like it’s 2018!)
pixely
0
1.8k
Spooking Your Friends with Electron (BrooklynJS #59)
pixely
0
3.4k
Rebble.io by Peach Hack (#PonyDev @ BronyCon 2018)
pixely
0
180
Sweetie Bot, Part 3 by Cloud Hop (#PonyDev @ BronyCon 2018)
pixely
0
95
Pony Podcast Programming by Corpulent Brony (#PonyDev @ BronyCon 2018)
pixely
1
110
How Equestria Was Made: Building EFNW's Website by Pixely (Everfree Northwest 2018)
pixely
0
440
IRC: Why it Failed by Cadey (#PonyDev @ Everfree Northwest 2018)
pixely
0
110
Other Decks in Technology
See All in Technology
欠陥分析(ODC分析)における生成AIの活用プロセスと実践事例 / 20260320 Suguru Ishii & Naoki Yamakoshi & Mayu Yoshizawa
shift_evolve
PRO
0
390
Phase04_ターミナル基礎
overflowinc
0
2.2k
新規事業×QAの挑戦:不確実性を乗りこなす!フェーズごとに求められるQAの役割変革
hacomono
PRO
0
180
Astro Islandsの 内部実装を 「日本で一番わかりやすく」 ざっくり解説!
knj
1
260
Laravelで学ぶOAuthとOpenID Connectの基礎と実装
kyoshidaxx
4
1.8k
DMBOKを使ってレバレジーズのデータマネジメントを評価した
leveragestech
0
240
Amazon Qはアマコネで頑張っています〜 Amazon Q in Connectについて〜
yama3133
1
100
モジュラモノリス導入から4年間の総括:アーキテクチャと組織の相互作用について / Architecture and Organizational Interaction
nazonohito51
5
2.2k
FastMCP OAuth Proxy with Cognito
hironobuiga
3
180
Navigation APIと見るSvelteKitのWeb標準志向
yamanoku
2
110
20260323_データ分析基盤でGeminiを使う話
1210yuichi0
0
170
「捨てる」を設計する
kubell_hr
0
230
Featured
See All Featured
End of SEO as We Know It (SMX Advanced Version)
ipullrank
3
4.1k
Designing Powerful Visuals for Engaging Learning
tmiket
0
290
Art, The Web, and Tiny UX
lynnandtonic
304
21k
Building a Scalable Design System with Sketch
lauravandoore
463
34k
DevOps and Value Stream Thinking: Enabling flow, efficiency and business value
helenjbeal
1
150
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
480
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
1
980
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.2k
A brief & incomplete history of UX Design for the World Wide Web: 1989–2019
jct
1
330
Automating Front-end Workflow
addyosmani
1370
200k
Information Architects: The Missing Link in Design Systems
soysaucechin
0
840
Product Roadmaps are Hard
iamctodd
PRO
55
12k
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