Nice and easy, man, we're familiar with reactor basics, of course, let's make things a bit interesting
and talk about the error page as well as why we would want to use a switch component as well.
And as far as the error page, well, if we go right now to the URL and if I go forward online.
Hello, what do you think is going to happen?
I have three pages of home I have about and I have people who are in the euro.
Well, I'm navigating to a hello.
And with our current setup, the only thing we're displaying is a empty page.
It would be a better experience if at least we would tell the user to, hey, listen, such a page doesn't
exist.
And then he or she can navigate to some different page.
Most likely the homepage and of course, the answer is that, yes, that would be a better step.
And the first thing we would need to do is go with our page.
So, of course, that is going to be our component.
But as far as setting up the road, it's going to be a little bit different where we go with a route
component and for the path we go here with the star.
So instead of setting up for error or not found, we just go here with a star.
Now, with star means that it will always, always match.
And of course, in here I would want to display the error component and now you'll see that I have my
herbage and technically everything works nice.
Now I have my halo.
We haven't covered links yet, so don't worry.
Eventually we will add here a link that allows us to navigate to a different page.
But at least it's a good start.
Once we navigate to a page that doesn't exist, whether that is a halo or shake and bake.
And of course we have the error page.
Now, the problem here is going to be a bit different, where once they navigate to a homepage, I can
see the error page.
Once I navigate to a board page, I'll also be able to see the error page.
Why?
Because this one always matches and this is where the switch component comes into play.
We'll go with Aruda and then we'll have our switch component and we'll push all our routes and the switch
component and with a switch component, only the first one that matches is displayed.
So that way, if I go to a homepage, then I can only see the home page.
If I go to about page, of course, on the about page.
But if all nicely go to a hole, since this one always matches, we have the error page.
That's how we can set up error page with a switch component and react to.