Narrator: Our application
is looking pretty darn good right now.
We have the ability to sign in, sign up, and sign out.
We also have the ability to protect individual routes.
One quick little breather task in here
that we need to take care of
that we haven't really gotten to just yet
is that when we're sitting on the root route right here,
we don't really see anything on the screen,
which is, eh, you know, a little bit weird.
It'd be really nice if we had an area
to kind of put a little bit of, say, marketing language
or something like that.
So in other words,
whenever a user is sitting at the root route,
we wanna show some content
inside of our applications body right here.
If you recall talking about React Router in the past,
whenever we are visiting a route
that does not match any child routes,
if we wanna show some content on the screen,
kind of like some default content, so to speak,
we can set up an index route.
So we've already in included or imported
the IndexRoute helper from React Router.
All we have to do is declare our IndexRoute
underneath our root route that shows "App" right now.
An IndexRoute, of course, does not need a path
because it's only matched when only the parent is matched.
So we can add on here a component
and I'm just gonna call this component "Welcome."
And so the purpose of Welcome
is just gonna be to show some simple text to the user.
Just something to say "hi."
We haven't created Welcome just yet.
So I'm going to import it into this file
and then we'll create the file for the component.
Then inside of components,
I'm gonna make a new file called Welcome.
And this is gonna be just dead simple.
We are going to import React from react
and then we'll export default a fat arrow function
that just contains a div and it should simply say,
"Welcome to our slice of paradise."
So just a very simple greeting for our users.
I'm gonna save this, let's test it out in the browser.
And now when we're on the root route,
only we see the text, "Welcome to our slice of paradise."
But I'm sure you could definitely imagine
how we might want to turn this into a big welcoming page
or a marketing page of sorts
and, you know, tell people about what our product does
and why they should sign up for it.
So definitely a lot of different applications to take
with this well component.
Okay, so nice little breather here.
Let's get back into the little bit more challenging stuff
inside the next section.