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.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
More Decks by Inky Collective
See All by Inky Collective
Glowing Up... with Ponies!
pixely
0
71
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
110
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
450
IRC: Why it Failed by Cadey (#PonyDev @ Everfree Northwest 2018)
pixely
0
120
Other Decks in Technology
See All in Technology
入門!AWS Blocks
ysuzuki
1
170
AIチャットの改善から見えた、良いAI体験とは / What Constitutes a Good AI Experience: Insights from Improving AI Chat
kubode
0
110
WebGIS AI Agentの紹介
_shimizu
0
250
ぼっちではじめた登壇が「51名」「241件」の発信に化けた
subroh0508
1
290
不要なレビューをAIにまかせて AIコーディングの環境改善を加速した
shoota
1
250
攻撃者視点で考えるDetection Engineering
cryptopeg
3
2k
自分が詳しくない領域でAIを使う #プロヒス2026
konifar
20
7k
SONiCで構築・運用する生成AI向けパブリッククラウドネットワーク ~実装編~
sonic
0
320
ザ・データベース、MySQL ~ OSC 2026 Sendai ~
sakaik
0
170
脱SaaS!FDEを支えるプロビジョニングと分離設計
knih
0
260
時期が悪い!それでもRaspberry Piを買って遊んで活用するには / 20260627-osc26do-rpi-jikigawarui
akkiesoft
0
110
LayerX コーポレートエンジニアリング室におけるサプライチェーンセキュリティへの取り組み / Supply Chain Security at LayerX Corporate Engineering
yuyatakeyama
3
770
Featured
See All Featured
Raft: Consensus for Rubyists
vanstee
141
7.5k
Scaling GitHub
holman
464
140k
Noah Learner - AI + Me: how we built a GSC Bulk Export data pipeline
techseoconnect
PRO
0
200
Building Flexible Design Systems
yeseniaperezcruz
330
40k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
133
19k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
55
3.4k
The Illustrated Children's Guide to Kubernetes
chrisshort
51
52k
Intergalactic Javascript Robots from Outer Space
tanoku
273
27k
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
430
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
210
Become a Pro
speakerdeck
PRO
31
6k
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
590
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