All language subtitles for 002 What are _Custom Hooks____en

af Afrikaans
ak Akan
sq Albanian
am Amharic
ar Arabic
hy Armenian
az Azerbaijani
eu Basque
be Belarusian
bem Bemba
bn Bengali
bh Bihari
bs Bosnian
br Breton
bg Bulgarian
km Cambodian
ca Catalan
chr Cherokee
ny Chichewa
zh-CN Chinese (Simplified)
zh-TW Chinese (Traditional)
co Corsican
hr Croatian
cs Czech
da Danish
nl Dutch
en English
eo Esperanto
et Estonian
ee Ewe
fo Faroese
tl Filipino
fi Finnish
fr French
fy Frisian
gaa Ga
gl Galician
ka Georgian
de German
el Greek
gn Guarani
gu Gujarati
ht Haitian Creole
ha Hausa
haw Hawaiian
iw Hebrew
hi Hindi
hu Hungarian
is Icelandic
ig Igbo
id Indonesian
ia Interlingua
ga Irish
it Italian
ja Japanese
jw Javanese
kn Kannada
kk Kazakh
rw Kinyarwanda
rn Kirundi
kg Kongo
ko Korean
kri Krio (Sierra Leone)
ku Kurdish
ckb Kurdish (SoranĂ®)
ky Kyrgyz
lo Laothian
la Latin
lv Latvian
ln Lingala
lt Lithuanian
loz Lozi
lg Luganda
ach Luo
mk Macedonian
mg Malagasy
ms Malay
ml Malayalam
mt Maltese
mi Maori
mr Marathi
mfe Mauritian Creole
mo Moldavian
mn Mongolian
sr-ME Montenegrin
ne Nepali
pcm Nigerian Pidgin
nso Northern Sotho
no Norwegian
nn Norwegian (Nynorsk)
oc Occitan
or Oriya
om Oromo
ps Pashto
fa Persian
pl Polish
pt-BR Portuguese (Brazil)
pt-PT Portuguese (Portugal)
pa Punjabi
qu Quechua
ro Romanian
rm Romansh
nyn Runyakitara
ru Russian
gd Scots Gaelic
sr Serbian
sh Serbo-Croatian
st Sesotho
tn Setswana
crs Seychellois Creole
sn Shona
sd Sindhi
si Sinhalese
sk Slovak
sl Slovenian
so Somali
es Spanish
es-419 Spanish (Latin American)
su Sundanese
sw Swahili
sv Swedish
tg Tajik
ta Tamil
tt Tatar
te Telugu
th Thai
ti Tigrinya
to Tonga
lua Tshiluba
tum Tumbuka
tr Turkish
tk Turkmen
tw Twi
ug Uighur
uk Ukrainian
ur Urdu
uz Uzbek
vi Vietnamese
cy Welsh
wo Wolof
xh Xhosa
yi Yiddish
yo Yoruba
zu Zulu
Would you like to inspect the original subtitles? These are the user uploaded subtitles that are being translated: 1 00:00:02,300 --> 00:00:05,420 So, what are custom hooks? 2 00:00:05,420 --> 00:00:08,160 And we need to clarify what they are 3 00:00:08,160 --> 00:00:10,570 before I can dive into the why. 4 00:00:10,570 --> 00:00:13,270 So, what are custom hooks? 5 00:00:13,270 --> 00:00:18,270 Custom hooks are, in the end, just regular functions 6 00:00:18,480 --> 00:00:21,970 just as the built-in hooks, like use state, are 7 00:00:21,970 --> 00:00:26,550 in the end just functions, but they are functions 8 00:00:26,550 --> 00:00:30,140 which can contain stateful logic. 9 00:00:30,140 --> 00:00:33,930 You can build custom hooks, these custom hook functions 10 00:00:33,930 --> 00:00:38,930 to outsource stateful logic into reusable functions. 11 00:00:39,870 --> 00:00:44,180 Unlike regular functions, custom hooks can use 12 00:00:44,180 --> 00:00:47,690 other React hooks, including other custom hooks. 13 00:00:47,690 --> 00:00:52,220 And they can, therefore, also leverage React state managed 14 00:00:52,220 --> 00:00:55,180 with use state or use reducer. 15 00:00:55,180 --> 00:00:58,670 They can access use effect and so on. 16 00:00:58,670 --> 00:01:02,770 With custom hooks, you can outsource logic, 17 00:01:02,770 --> 00:01:05,580 which you might be using in different components, 18 00:01:05,580 --> 00:01:08,200 into a custom hook, which you can then call 19 00:01:08,200 --> 00:01:11,210 from all these various components. 20 00:01:11,210 --> 00:01:14,980 So, it is simply a mechanism of reusing logic, 21 00:01:14,980 --> 00:01:19,510 just as regular functions are with the special thing 22 00:01:19,510 --> 00:01:22,150 that in these custom hook functions, 23 00:01:22,150 --> 00:01:25,950 you can use React hooks and other hooks. 24 00:01:25,950 --> 00:01:29,710 And that might, of course, still be a bit abstract. 25 00:01:29,710 --> 00:01:31,230 So, therefore, let me give you 26 00:01:31,230 --> 00:01:33,840 a concrete example which shows you 27 00:01:33,840 --> 00:01:37,070 why you might wanna explore custom hooks 28 00:01:37,070 --> 00:01:39,860 and how you then build a custom hook, 29 00:01:39,860 --> 00:01:42,203 step-by-step and how you use it. 2315

Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.