All language subtitles for 030 Exercise_ Where To Put State__en

af Afrikaans
ak Akan
sq Albanian
am Amharic
hy Armenian
az Azerbaijani
eu Basque
be Belarusian
bem Bemba
bn Bengali
bh Bihari
bs Bosnian
br Breton
bg Bulgarian
km Cambodian
ca Catalan
ceb Cebuano
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
hmn Hmong
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
lb Luxembourgish
mk Macedonian
mg Malagasy
ms Malay
ml Malayalam
mt Maltese
mi Maori
mr Marathi
mfe Mauritian Creole
mo Moldavian
mn Mongolian
my Myanmar (Burmese)
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 Portuguese (Portugal)
pa Punjabi
qu Quechua
ro Romanian
rm Romansh
nyn Runyakitara
ru Russian
sm Samoan
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

Original subtitles

Hey, it's Andre here, some of you might be wondering why we don't add state to search box.

I mean, it looks like what we're doing is adding the on change over here, giving it a function, and

this function goes up a level and letting our apgar's know that there was an event.

But search box, shouldn't that have the search field state?

Let's explore that.

Now, I want you to think about this.

Why wouldn't we put state here?

Pause avideo, think about it.

Let's find out what.

Remember our third point over here, a good reactive holper decide, decides what changes when state

changes.

Let's think about this.

Now, the reason we don't change the state in search box and instead we trigger whenever an event happens

to handle change up here in Ajaz is because our other component card list needs to have that information

right.

Remember, the way we filtered monsters was by using the search field state to filter based on the user

input.

So the way to think about this is like, so if we had our app over here and this is our objets, and

in here we have the search component and the card list component.

If the state was only here in the search box component, there's no way for the Kahless component to

find out about it.

Remember, because of one way dataflow data can only flow one way.

So there's no way for, let's say, the search for state to move up and down to the cardless component.

So instead, we want to place the state in a place where it gives us access to whatever needs it.

In our case, both Carlist and search box need that state, that search field state.

So we move it up.

And the way we architect things and react is that when an event happens on a component, let's say a

user clicks or type something, well, that event triggers the react event system and says, hey, something

has happened.

Create an event handler like handle input or handle change.

And it's going to go up and let the component that has that state know that, hey, something has happened.

You need to update state and how far up that goes.

Let's say we had a component underneath this.

We notify the component that has the state as far up as we need to in order to pass down that information

to the components that need that information.

Now, if you don't get this right away, don't worry.

This is something that comes with practice that we're going to explore throughout the course as we build

more and more projects.

But I want you to pay attention that you want to decide as a reactive helper what changes, what events

that the user's take, how far up it goes to let the state know.

And you want to move the state in a high enough position so that we are still able to pass down that

information to different notes, but at the same time.

If we had, let's say, a state in here that the only people that care about it is these two components.

Well, if that's the case, there's no point bringing up the state all the way up here.

You want to place the state over here because all these components don't really care about any of this.

Again, this is a topic that will cover a lot more.

And structuring state is a very big topic.

And yet but I want you to start noticing these things.

Let's keep going.

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