Setting up Nested Routes
Learn to create and set up nested routes.
Nested routes are used by the admin side of the application to load different categories. First, let’s discuss what we want to achieve using nested routing.
Requirements
Admin page
Look at the mock-up design below to get an overview of the structure for the admin
route:
Our admin page contains the following two parts:
- One loads all the products, and the user can click to edit them.
- On the other part, the
add
oredit
route loads one at a time. Theadd
route loads a product when the user clicks the “Add” button as shown in the picture above. Theedit
route loads a product when the user clicks a product