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
Visual Intro to Custom React Hooks
Search
Inky Collective
July 16, 2019
Technology
2.7k
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Visual Intro to Custom React Hooks
Lightning talk @ Reactadelphia July 2019! melody.dev/custom-hooks
Inky Collective
July 16, 2019
Transcript
16 slides
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
More Decks by Inky Collective
See All by Inky Collective
Glowing Up... with Ponies!
pixely
0
88
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.5k
Rebble.io by Peach Hack (#PonyDev @ BronyCon 2018)
pixely
0
190
Sweetie Bot, Part 3 by Cloud Hop (#PonyDev @ BronyCon 2018)
pixely
0
120
Pony Podcast Programming by Corpulent Brony (#PonyDev @ BronyCon 2018)
pixely
1
120
How Equestria Was Made: Building EFNW's Website by Pixely (Everfree Northwest 2018)
pixely
0
470
IRC: Why it Failed by Cadey (#PonyDev @ Everfree Northwest 2018)
pixely
0
130
Other Decks in Technology
See All in Technology
マネージャーをエスパーにしない マネジメントされる側から始める、働きやすい現場づくり
comi190327
1
790
AI-Ready なデータ基盤ってなに? & 新卒未経験が、いま考えていること
imuta
0
780
Amazon Bedrock AgentCore の基礎とセキュリティ・ガバナンス
ren8k
0
160
Context parameters で作る!はじめての型クラス
kworkdev
PRO
1
160
エンタープライズIAMについて - ID・権限をどう統制するか
oidfj
1
210
コピーオンライト型ファイルシステムと ランダム書き込み
sat
PRO
2
130
IP重複は"ランディングVPC"で受け止める ― PrivateLink と Transit Gatewayによるマルチテナント接続基盤の設計
hatahata021
3
250
AIで実装が加速したのに、 なぜ私は仕事の大半で人と話し続けていたのか?
say_no_w
0
190
未来を描き変化の中で学び直す ヴァンガードから考える、AI時代のチーム開発
lamb_moko
0
100
これからのデータエンジニアの役割について考える / Rethinking the Role of Data Engineers in the AI Era
okiyuki99
1
540
「任されビリティ」で引き受けて「よしなりてぃ」に頼らず任せる / Accept tasks with "makasarebility" and hand them over without relying on "yoshinarily"
pauli
1
810
異夢同船〜異なる夢でも同じ船でなんとかする〜
fortegp05
1
530
Featured
See All Featured
The Curse of the Amulet
leimatthew05
4
17k
Documentation Writing (for coders)
carmenintech
77
5.6k
Building Flexible Design Systems
yeseniaperezcruz
330
41k
A designer walks into a library…
pauljervisheath
211
25k
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
980
How Software Deployment tools have changed in the past 20 years
geshan
3
35k
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
1
880
What’s in a name? Adding method to the madness
productmarketing
PRO
24
4.2k
Writing Fast Ruby
sferik
630
63k
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
680
It's Worth the Effort
3n
188
29k
How to optimise 3,500 product descriptions for ecommerce in one day using ChatGPT
katarinadahlin
PRO
3
3.9k