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 let's talk about simplifications
and what else we could do.
Now you could definitely try to outsource more Logic.
You could try to build individual input components
which contained some validation logic or whatever.
You could build an overall form component
which handles a lot of that.
You could build more custom hooks,
which for example, return entirely pre-configured inputs
or forms.
And attached you'll find an article on that
which might also be interesting to you
where we also build a complete use form hook
which even spits out readily configured
input elements which you can use in JSX.
I want to focus on the basics here, though,
and that is already a long module.
For me, it mattered to explain
how we can use what we learned about React
to build great user experiences
and to build forms and form behaviors
that make sense to our users.
That feel good to our users.
And at the same time, I, of course, also wanted to show you
that this can lead to a lot of unnecessary code
and therefore building something like this
custom use input hook can reduce code duplication
and allows us to reuse Logic
even though we now, of course,
still have some replicated code,
but it is distinct enough, I would argue.
Nonetheless, you can dive into building more
elaborate custom hooks
and this attached article might be interesting for that.
In addition, there also are third-party libraries
that could be interesting to you.
For example, Formik.
Formik is a very popular third-party library
for working with forms
and you can dive into the official docs
to learn more about it.
It's not really using hooks that much,
it's more using components
and patterns we know from older versions of React,
so to say.
But nonetheless, it's a great library
when it comes to rendering forms
and dealing with more complex forms and validation.
Again, you can explore the official docs
to learn how it works.
The core idea is that you don't have to write much
state management logic
but that instead you write your validation logic,
you define your fields,
and then let Formik do the rest.
A little bit as we did it with our custom-use input hook.
There we also focused on passing in the validation logic
and the hook then manages the state for us.
Formik then just has more use cases
and outsources even more Logic,
or allows us to outsource even more Logic to it.
So that might definitely be worth a look.
Now for this course though,
I'm happy with this approach.
You again got more practice
with working with custom hooks,
and you really see what's going on behind the scenes.
Now you are definitely well prepared
to handle the forms and user input
in your next project, and of course
we are also going to work a bit more with forms
in the course projects you'll find
in the rest of this course.
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.