1 00:00:00,180 --> 00:00:06,840 Now we have learned how to consume multiple contests and I think you should already realize how ugly 2 00:00:06,900 --> 00:00:10,850 it is to consume the contest in this way. 3 00:00:11,010 --> 00:00:18,080 If they use contest hook we can literally use contests within the Functional Component with ease. 4 00:00:18,100 --> 00:00:21,220 It's also much better to read and write. 5 00:00:21,270 --> 00:00:24,400 Let's look at an example to understand it better. 6 00:00:25,260 --> 00:00:28,730 And this time we go to the component B to consume. 7 00:00:28,740 --> 00:00:36,310 I use a contest and a color contest so we will also display the name and also the color. 8 00:00:36,480 --> 00:00:39,440 First we have to imposter use contest and. 9 00:00:39,480 --> 00:00:40,110 We at 10 00:00:43,730 --> 00:00:45,430 then in fact a complete and B. 11 00:00:45,440 --> 00:00:54,560 We are going to use the use contest and we set a constant user is equal to use contest 12 00:00:59,460 --> 00:01:08,850 but we've all got to import the contest so we need to import user contests and Carl Icahn cats 13 00:01:11,580 --> 00:01:12,030 from 14 00:01:15,100 --> 00:01:23,410 from the app and then we used to use contests to use to use the contacts and also we will use these 15 00:01:25,570 --> 00:01:26,560 kinda contests 16 00:01:32,470 --> 00:01:39,460 we should use the name contests rather than the user contests. 17 00:01:39,460 --> 00:01:50,440 Now we are going to display the name using name and credit basis name and also color coded basis. 18 00:01:53,350 --> 00:02:02,800 And because it uses name so we have to change to name rather than user and let's take a look. 19 00:02:02,880 --> 00:02:08,300 Now you can see both component B and competency displayed a name and also the color. 20 00:02:08,790 --> 00:02:14,960 But now you can see the new way of consuming the contest is better than the previous one. 21 00:02:15,150 --> 00:02:17,030 And this is much easier to read.