So life is awesome, but what happens if the user navigates to a page that doesn't exist?
For example, forward slash and armhole.
The moment we're just rounding an empty screen, and you would have to agree that that is not the best
user experience.
It would be probably better if we would render some kind of error page and give the option to a user,
navigate back to a dashboard or logging or wherever you would like.
And in order to set it up, we will need to set up another out.
We're going to go with our aroud component and then within that rolled component.
We are going to place our error page.
So, of course, the structure for the Yellow Pages are already there.
It is already exported from the pages folder and now we just place it in the route.
Now, in order to set up a error page, we will have to have a path with a value of star.
Now, what that means is that this will always match whatever we are looking for, whether that is a
home page or logging or whatever.
So once we set up our out path prop equal to his star.
That just means that every time we're going to navigate somewhere, this is always going to match.
And just to showcase that.
Of course, we show that in the low.
But at the moment, the problem is going to be that will also display our error page in a dashboard
as well as the log.
So how we can fix that?
Well, we can fix that by adding a switch component.
So where we have the router inside of it.
So not inside or out, but inside of the router.
Let's add our switch component and let's wrap all our roots in our switch component.
Now, you'll notice that we're going to display properly dashboard page once we navigate to a homepage.
Then a log page.
If we navigate to a log in page, of course.
And then, of course, the halo is going to bring us the error page.
And why is that happening?
Well, because switch verandahs the first child crowd that matches.
So, of course, that's why when we navigate to a homepage, we are displaying home, because that is
the first one that matches our path.
Always matches, like I just said.
So when we navigate to a page, it doesn't exist.
That's where displaying the error page.
That should do it for a router.
Now let's start working on some more interesting things.