Afrikaans
Akan
Albanian
Amharic
Arabic
Armenian
Azerbaijani
Basque
Belarusian
Bemba
Bengali
Bihari
Bosnian
Breton
Bulgarian
Cambodian
Catalan
Cebuano
Cherokee
Chichewa
Chinese (Simplified)
Chinese (Traditional)
Corsican
Croatian
Czech
Danish
Dutch
English
Esperanto
Estonian
Ewe
Faroese
Filipino
Finnish
French
Frisian
Ga
Galician
Georgian
German
Greek
Guarani
Gujarati
Haitian Creole
Hausa
Hawaiian
Hebrew
Hindi
Hmong
Hungarian
Icelandic
Igbo
Indonesian
Interlingua
Irish
Italian
Japanese
Javanese
Kannada
Kazakh
Kinyarwanda
Kirundi
Kongo
Korean
Krio (Sierra Leone)
Kurdish
Kurdish (Soranรฎ)
Kyrgyz
Laothian
Latin
Latvian
Lingala
Lithuanian
Lozi
Luganda
Luo
Luxembourgish
Macedonian
Malagasy
Malay
Malayalam
Maltese
Maori
Marathi
Mauritian Creole
Moldavian
Mongolian
Myanmar (Burmese)
Montenegrin
Nepali
Nigerian Pidgin
Northern Sotho
Norwegian
Norwegian (Nynorsk)
Occitan
Oriya
Oromo
Pashto
Polish
Portuguese (Brazil)
Portuguese (Portugal)
Punjabi
Quechua
Romanian
Romansh
Runyakitara
Russian
Samoan
Scots Gaelic
Serbian
Serbo-Croatian
Sesotho
Setswana
Seychellois Creole
Shona
Sindhi
Sinhalese
Slovak
Slovenian
Somali
Spanish
Spanish (Latin American)
Sundanese
Swahili
Swedish
Tajik
Tamil
Tatar
Telugu
Thai
Tigrinya
Tonga
Tshiluba
Tumbuka
Turkish
Turkmen
Twi
Uighur
Ukrainian
Urdu
Uzbek
Vietnamese
Welsh
Wolof
Xhosa
Yiddish
Yoruba
Zulu
Now that's it for this introduction
to class-based components.
I showed you that they exist, how they work
and how you write your own ones,
how you work with prompts and the render method,
how you work with state, and also how you work
with these life cycle methods for side effects
and we also had a look at how you use context.
You can build your entire application
with class-based components if you want to.
That is absolutely fine.
And in the past, as I mentioned, you had to use them
in some cases.
But in modern React apps, you typically
stick to functional components instead,
simply because they are leaner and more flexible,
as you learned throughout this module.
That's why I also started with functional components
in this course now, because the React Echo system
transitioned to functional components as the main thing
and that's why I focus on functional components
in this course.
Also, going forward, for the rest of this course,
functional components will be the focus
and I will only occasionally show you
how to work with class-based components.
Nonetheless, I wanna emphasize that you don't have to use
functional components, it is fine to use class-based ones
if you prefer them,
but chances are that you also see the benefits
of functional components, and therefore it is fine
to generally ignore class-based components.
With one exception, to which I'll come back to
in a couple of minutes.
Now if you're not sure which approach to use,
if you're not sure whether you wanna go with class-based
or functional components, here's a little
helper decision tree, if you wanna call it like that.
As a general rule, you should simply prefer
functional components and you should instead
use class-based components if you personally prefer them
so if you disagree, if you like them,
of course you can use them, there's nothing wrong with them.
If you are working on a project or if you're in a team
where there are a lot of class-based components being used,
you might not have a choice then and you might be
confusing your colleagues if you start working
with functional components only,
and you also should use, and you must use,
class-based components if you're building error boundaries.
Now, that's something we haven't learned yet,
but that's exactly what we're going to take a look at
in the next lecture now.
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.