1 00:00:00,120 --> 00:00:07,140 Nice and easy, man, we're familiar with reactor basics, of course, let's make things a bit interesting 2 00:00:07,440 --> 00:00:14,660 and talk about the error page as well as why we would want to use a switch component as well. 3 00:00:15,300 --> 00:00:22,870 And as far as the error page, well, if we go right now to the URL and if I go forward online. 4 00:00:22,890 --> 00:00:25,270 Hello, what do you think is going to happen? 5 00:00:25,980 --> 00:00:31,860 I have three pages of home I have about and I have people who are in the euro. 6 00:00:32,400 --> 00:00:34,770 Well, I'm navigating to a hello. 7 00:00:35,710 --> 00:00:41,750 And with our current setup, the only thing we're displaying is a empty page. 8 00:00:42,160 --> 00:00:49,450 It would be a better experience if at least we would tell the user to, hey, listen, such a page doesn't 9 00:00:49,450 --> 00:00:49,840 exist. 10 00:00:50,700 --> 00:00:54,510 And then he or she can navigate to some different page. 11 00:00:54,750 --> 00:01:00,740 Most likely the homepage and of course, the answer is that, yes, that would be a better step. 12 00:01:01,170 --> 00:01:05,940 And the first thing we would need to do is go with our page. 13 00:01:06,180 --> 00:01:09,060 So, of course, that is going to be our component. 14 00:01:09,330 --> 00:01:16,170 But as far as setting up the road, it's going to be a little bit different where we go with a route 15 00:01:16,170 --> 00:01:21,080 component and for the path we go here with the star. 16 00:01:21,300 --> 00:01:27,630 So instead of setting up for error or not found, we just go here with a star. 17 00:01:28,020 --> 00:01:31,370 Now, with star means that it will always, always match. 18 00:01:31,770 --> 00:01:39,530 And of course, in here I would want to display the error component and now you'll see that I have my 19 00:01:39,540 --> 00:01:42,190 herbage and technically everything works nice. 20 00:01:42,600 --> 00:01:43,820 Now I have my halo. 21 00:01:43,830 --> 00:01:46,320 We haven't covered links yet, so don't worry. 22 00:01:46,350 --> 00:01:52,350 Eventually we will add here a link that allows us to navigate to a different page. 23 00:01:52,710 --> 00:01:54,290 But at least it's a good start. 24 00:01:54,660 --> 00:02:00,330 Once we navigate to a page that doesn't exist, whether that is a halo or shake and bake. 25 00:02:00,520 --> 00:02:02,160 And of course we have the error page. 26 00:02:02,730 --> 00:02:09,750 Now, the problem here is going to be a bit different, where once they navigate to a homepage, I can 27 00:02:09,750 --> 00:02:10,560 see the error page. 28 00:02:11,010 --> 00:02:16,520 Once I navigate to a board page, I'll also be able to see the error page. 29 00:02:16,530 --> 00:02:16,860 Why? 30 00:02:17,250 --> 00:02:23,760 Because this one always matches and this is where the switch component comes into play. 31 00:02:24,980 --> 00:02:34,720 We'll go with Aruda and then we'll have our switch component and we'll push all our routes and the switch 32 00:02:34,720 --> 00:02:41,310 component and with a switch component, only the first one that matches is displayed. 33 00:02:41,590 --> 00:02:46,480 So that way, if I go to a homepage, then I can only see the home page. 34 00:02:46,810 --> 00:02:50,290 If I go to about page, of course, on the about page. 35 00:02:50,290 --> 00:02:56,600 But if all nicely go to a hole, since this one always matches, we have the error page. 36 00:02:57,010 --> 00:03:01,810 That's how we can set up error page with a switch component and react to.