1 00:00:02,490 --> 00:00:09,000 So we worked on these forms here or on these inputs where we can fetch user input for adding new products 2 00:00:09,450 --> 00:00:14,840 and that of course is a core thing you'll probably have to do in any application. 3 00:00:14,850 --> 00:00:20,400 Now here, I showed you all the nitty gritty details it takes to set this up from scratch on your own 4 00:00:20,430 --> 00:00:26,400 and of course this is only one possible approach. You could have managed all the state individually with 5 00:00:26,400 --> 00:00:35,730 multiple use state states in one component. Here instead, I use use reducer and this merged state to have 6 00:00:35,730 --> 00:00:42,420 all the state that belongs together together and I use a separate component for the actual input 7 00:00:42,420 --> 00:00:46,970 and its label and the error text and the validation of this input text 8 00:00:47,100 --> 00:00:52,410 and of course that's also just one possible pattern. Now in production of course, you might not 9 00:00:52,410 --> 00:00:54,750 want to reinvent the wheel all the time, 10 00:00:54,750 --> 00:00:59,910 so instead of writing all that validation logic manually here, as I mentioned already, you might want 11 00:00:59,910 --> 00:01:06,870 to check out solutions like ValidateJS which gives you preconfigured validation patterns and functionalities, 12 00:01:07,290 --> 00:01:11,280 so that you don't have to add your own email regex and so on. 13 00:01:11,280 --> 00:01:17,400 You can also look into packages like formik which is a third-party React package that also works 14 00:01:17,400 --> 00:01:22,770 for React Native which makes adding forms and validating forms even easier 15 00:01:22,890 --> 00:01:27,710 and you can check out the official docs to learn more about it and to also learn how to use it in React 16 00:01:27,720 --> 00:01:30,900 Native apps because you'll find a description about that there. 17 00:01:30,930 --> 00:01:35,580 However, I found it more interesting to show you what happens behind the scenes and how you can set up 18 00:01:35,580 --> 00:01:40,290 something like this from scratch because ultimately this course is about becoming a developer and not 19 00:01:40,290 --> 00:01:42,700 about becoming a copy and paster I guess. 20 00:01:42,750 --> 00:01:48,600 So I hope this was helpful for understanding what's happening behind the scenes, how you can manage validity 21 00:01:48,600 --> 00:01:51,630 and values elegantly and in a reusable way 22 00:01:51,720 --> 00:01:57,810 and we will also reuse the inputs later in the authentication section once we also add an authentication 23 00:01:57,810 --> 00:02:03,690 screen and there, we will then also see how easy it is to add yet another form to this application.