Defining the Routes
Let's learn how to define routes in a React application.
We'll cover the following...
We'll cover the following...
In this lesson, we’ll define the routes of our Navbar. The code files created previously have been provided below as a starting point:
import React from 'react'
function Login() {
return (
<div className="App">
Login
</div>
);
}
export default Login;The initial files we will build on
Adding the routes
After the navbar section in the App.js file, add the route section by adding the code below:
We use a Switch component to switch between different routes. The ...