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.5k
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
Let's Talk Transit Cards!
pixely
3
1.5k
Glowing Up... with Ponies!
pixely
0
29
lo-fi hip hop beats to npm install to!
pixely
0
2.8k
Web Development w/ IE6 (like it’s 2018!)
pixely
0
1.6k
Spooking Your Friends with Electron (BrooklynJS #59)
pixely
0
3.2k
Rebble.io by Peach Hack (#PonyDev @ BronyCon 2018)
pixely
0
130
Sweetie Bot, Part 3 by Cloud Hop (#PonyDev @ BronyCon 2018)
pixely
0
52
Pony Podcast Programming by Corpulent Brony (#PonyDev @ BronyCon 2018)
pixely
1
73
How Equestria Was Made: Building EFNW's Website by Pixely (Everfree Northwest 2018)
pixely
0
320
Other Decks in Technology
See All in Technology
Cloud Native Java with Spring Boot (CNCF Aarhus, April 2024)
thomasvitale
1
170
自己改善からチームを動かす! 「セルフエンジニアリングマネージャー」のすゝめ
shoota
6
730
GraphQL 成熟度モデルの紹介と、プロダクトに当てはめた事例 / GraphQL maturity model
mh4gf
7
1.3k
リテール金融(キャッシュレス・ネット銀行・ネット証券)の競争環境と経済圏
8maki
0
1.2k
Google Cloud Next '24でブログを10本書いた方法と勉強会を沸かせた方法
yasumuusan
0
300
IaCジェネレーターとBedrockで詳細設計書を生成してみた
tsukasa_ishimaru
1
240
Janus
bkuhlmann
1
490
検証を通して見えてきたTiDBの性能特性
lycorptech_jp
PRO
6
3.8k
MLOpsの「壁」を乗り越える、LINEヤフーの Data Quality as Code
lycorptech_jp
PRO
5
530
オーナーシップを持つ領域を明確にする
konifar
13
3.2k
元インフラエンジニアに成る / Human Resources to Human Relations
bobtani
4
920
Reducing Cross-Zone Egress at Spotify with Custom gRPC Load Balancing Recap
koh_naga
0
210
Featured
See All Featured
Building Better People: How to give real-time feedback that sticks.
wjessup
355
18k
Documentation Writing (for coders)
carmenintech
60
3.9k
Gamification - CAS2011
davidbonilla
76
4.6k
Fireside Chat
paigeccino
21
2.6k
Reflections from 52 weeks, 52 projects
jeffersonlam
345
19k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
125
32k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
60
14k
Bash Introduction
62gerente
604
210k
Robots, Beer and Maslow
schacon
PRO
155
7.9k
No one is an island. Learnings from fostering a developers community.
thoeni
16
2.1k
Optimizing for Happiness
mojombo
370
69k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
221
21k
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