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
What the Hook ?
Search
Adnan A M
July 09, 2020
Programming
100
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
What the Hook ?
React Hooks presentation
Adnan A M
July 09, 2020
More Decks by Adnan A M
See All by Adnan A M
Abridge Coding Guidelines
adnan321
0
76
A developer's guide to wealth
adnan321
0
290
Scoping Your Storage
adnan321
2
190
What The Context ?
adnan321
2
240
Putting Work Manager To Work
adnan321
0
120
OOP To FP
adnan321
1
220
Putting Work Manager To Work
adnan321
1
190
A slice of Android Slices - droidcon London 2018
adnan321
0
130
Having fun with Kotlin fun()
adnan321
0
120
Other Decks in Programming
See All in Programming
AIキャラアプリkaiwaの低遅延音声通話基盤をどう作ったか - AWS Gravitonで支える低遅延・低コストAI Agent基盤
mogamit
0
180
なぜ関数型プログラミングで「型」と「証明」が語られるのか #fp_matsuri
kajitack
3
1k
광주소프트웨어마이스터고등학교 DevFest 특강 - 바이브 코딩 시대에서 주니어 개발자로 살아남는 방법
utilforever
1
150
ルールを書いて終わらせないハーネスエンジニアリング
yug1224
4
1.7k
Prismを使った型安全な暗号化_関数型まつり2026
_fhhmm
0
150
Welcome to the "Parametricity" 🏙️ − Generic だけど Specific な世界 −
guvalif
PRO
1
180
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
110
SREの積み重ねがAI駆動開発のガードレールになった ― 7つの実践/SRE Guardrails The 7
tomoyakitaura
8
5.1k
初めてのKubernetes 本番運用でハマった話
oku053
0
130
Generative UI & AI-Assistants for Your Angular Solutions
manfredsteyer
PRO
1
210
【SRE NEXT 2026 Lunch Session】一人目専任SREの立ち上げを加速する ― AIと進めたオンボーディングで2分を0.04秒にした話
pkshadeck
PRO
0
2.9k
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
340
Featured
See All Featured
The Organizational Zoo: Understanding Human Behavior Agility Through Metaphoric Constructive Conversations (based on the works of Arthur Shelley, Ph.D)
kimpetersen
PRO
0
390
Automating Front-end Workflow
addyosmani
1370
210k
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
260
Build The Right Thing And Hit Your Dates
maggiecrowley
39
3.3k
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
310
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
380
[RailsConf 2023] Rails as a piece of cake
palkan
59
6.8k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
133
19k
How STYLIGHT went responsive
nonsquared
100
6.2k
What's in a price? How to price your products and services
michaelherold
247
13k
Winning Ecommerce Organic Search in an AI Era - #searchnstuff2025
aleyda
1
2.1k
Navigating Team Friction
lara
192
16k
Transcript
W at he oo ? A 2 1
B ck ro nd A 2 2
C as C mp ne ts 4 c c 4
s (p ) 4 b m (O s a f n ) A 2 3
W at's ro g ? 4 L c l l
4 D t m e l l m 4 I m c o 4 S o l (H /r p a.k.a W l !) A 2 4
E te H ok ! A 2 5
W at s H ok ? A 2 6
P ai o d un ti n A 2 7
H w oe t at el ? 4 N e
o a c c & s (p ) 4 N 't ' A 2 8
W at bo t ta e & l fe yc
e ? import { useState } from 'react'; import { useEffect } from 'react'; import { useYourImagination } from 'yourImagination'; A 2 9
u eS at F h s p import { useState
} from 'react'; const [isLoading, setLoading] = useState(false); const [duration, setDuration] = useState(0); <p>You ran for {duration} minutes</p> <button onClick={() => setDuration(duration + 1)}>Add 1 Min</button> A 2 1
u eS at S c o import { useState }
from 'react'; const [encounter, setEncounter] = useState({ id: uuidv4(), period: { start: moment().valueOf() }, recordings: [], }); A 2 1
u eS at G import { useState } from 'react';
const [duration, setDuration] = useState(0); <button onClick={() => setDuration(duration + 1)}>Add 1 Min</button> R s s i M ! A 2 1
u eE e t import { useEffect } from 'react';
useEffect(() => { start(); }); A 2 1
u eE e t 4 R a e r i
n h s 4 H a s & p i h c n 4 E r c a e i e h e e t e A 2 1
u eE e t - c ea up useEffect(() =>
{ EventListener.subscribe(); return function cleanup() { EventListener.unsubscribe(); } }); A 2 1
u eE e t - O ti is d I
P a import { useEffect } from 'react'; useEffect(() => { start(); }, [props.someElement]); A 2 1
R le f r oo s 4 O l o
R F n 4 D 't l h i l , c o n f n A 2 1
D n t oo ! import { useEffect } from
'react'; // ! We're breaking the rule by using a Hook in conditions if (props.micAuthorized) { useEffect(function startOp() { start(); },[props.micAuthorized]); } A 2 1
R le f r oo s import { useEffect }
from 'react'; useEffect(() => { if (props.micAuthorized) { start(); } }, [props.micAuthorized]); A 2 1
C st m oo s import { BackHandler } from
'react-native'; componentDidMount() { this.backHandler = BackHandler.addEventListener('hardwareBackPress', this.handleAndroidBackPress); } componentWillUnmount() { this.backHandler.remove(); } A 2 2
C st m oo s import { useEffect } from
'react'; import { BackHandler } from 'react-native'; function useBackButton(handler) { useEffect(() => { BackHandler.addEventListener('hardwareBackPress', handler); return () => { BackHandler.removeEventListener('hardwareBackPress',handler); }; }, [handler]); } useBackButton(handleAndroidBackPress); A 2 2
P rt ng ho gh s... ! 4 T a
t s n n r a l l ☠ 4 T e e s n a u a e r " 4 S s c n r o e e y f n c n A 2 2
T an y u ! A 2 2