Defining Routes
Learn how to define routes based on path/URL matching using the Route component.
We'll cover the following
Route
component
Each component placed inside the <Router></Router>
element can access the router context, react to it, or manage it. We create routes by using the Route
component and providing a path
prop and an optional render
or component
prop (the exception being the render
prop must be a function that returns a valid React element. The component
prop expects a component, not an element.
The correct implementation of both props can be summarized as follows:
Get hands-on with 1400+ tech skills courses.