All language subtitles for 002 What are _Custom Hooks___en

af Afrikaans
sq Albanian
am Amharic
ar Arabic
hy Armenian
az Azerbaijani
eu Basque
be Belarusian
bn Bengali
bs Bosnian
bg Bulgarian
ca Catalan
ceb Cebuano
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
tl Filipino
fi Finnish
fr French
fy Frisian
gl Galician
ka Georgian
de German
el Greek
gu Gujarati
ht Haitian Creole
ha Hausa
haw Hawaiian
iw Hebrew
hi Hindi
hmn Hmong
hu Hungarian
is Icelandic
ig Igbo
id Indonesian
ga Irish
it Italian
ja Japanese
jw Javanese
kn Kannada
kk Kazakh
km Khmer
ko Korean
ku Kurdish (Kurmanji)
ky Kyrgyz
lo Lao
la Latin
lv Latvian
lt Lithuanian
lb Luxembourgish
mk Macedonian
mg Malagasy
ms Malay
ml Malayalam
mt Maltese
mi Maori
mr Marathi
mn Mongolian
my Myanmar (Burmese)
ne Nepali
no Norwegian
ps Pashto
fa Persian Download
pl Polish
pt Portuguese
pa Punjabi
ro Romanian
ru Russian
sm Samoan
gd Scots Gaelic
sr Serbian
st Sesotho
sn Shona
sd Sindhi
si Sinhala
sk Slovak
sl Slovenian
so Somali
es Spanish
su Sundanese
sw Swahili
sv Swedish
tg Tajik
ta Tamil
te Telugu
th Thai
tr Turkish
uk Ukrainian
ur Urdu
uz Uzbek
vi Vietnamese
cy Welsh
xh Xhosa
yi Yiddish
yo Yoruba
zu Zulu
or Odia (Oriya)
rw Kinyarwanda
tk Turkmen
tt Tatar
ug Uyghur
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.