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
2.6k
0
Share
Visual Intro to Custom React Hooks
Lightning talk @ Reactadelphia July 2019! melody.dev/custom-hooks
Inky Collective
July 16, 2019
More Decks by Inky Collective
See All by Inky Collective
Glowing Up... with Ponies!
pixely
0
65
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
96
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
NgRx SignalStore: The Power of Extensibility
rainerhahnekamp
0
190
MCPゲートウェイ MCPass の設計と実装 エンタープライズで AI を「運用できる」状態にする
mtpooh
1
220
"まず試す"ためのDatabricks Apps活用法 / Databricks Apps for Early Experiments and Validation
nttcom
1
230
AIを活用したアクセシビリティ改善フロー
degudegu2510
1
170
Oracle AI Database@Azure:サービス概要のご紹介
oracle4engineer
PRO
6
1.4k
Bluesky Meetup in Tokyo vol.4 - 2023to2026
shinoharata
0
140
Databricksを用いたセキュアなデータ基盤構築とAIプロダクトへの応用.pdf
pkshadeck
PRO
0
280
Zero-Downtime Migration: Moving a Massive, Historic iOS App from CocoaPods to SPM and Tuist without Stopping Feature Delivery
kagemiku
0
230
シン・リスコフの置換原則 〜現代風に考えるSOLIDの原則〜
jinwatanabe
0
180
2026年春から始めるOpenTelemetry | sogaoh's LT @ PHP Conference ODAWARA 2026
sogaoh
PRO
0
100
仕様通り動くの先へ。Claude Codeで「使える」を検証する
gotalab555
8
3.2k
新メンバーのために、シニアエンジニアが環境を作る時代
puku0x
0
630
Featured
See All Featured
Thoughts on Productivity
jonyablonski
76
5.1k
Balancing Empowerment & Direction
lara
5
1k
Evolving SEO for Evolving Search Engines
ryanjones
0
180
Unsuck your backbone
ammeep
672
58k
Designing for Timeless Needs
cassininazir
0
190
Believing is Seeing
oripsolob
1
110
コードの90%をAIが書く世界で何が待っているのか / What awaits us in a world where 90% of the code is written by AI
rkaga
61
43k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
Lessons Learnt from Crawling 1000+ Websites
charlesmeaden
PRO
1
1.2k
The untapped power of vector embeddings
frankvandijk
2
1.7k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.4k
A better future with KSS
kneath
240
18k
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