How it works...

The match object contains a lot of useful information. React Router also includes the object's history and location. As you can see, we can get all the parameters we pass within our routes in the match object.

If you run the application and go to /notes URL, you will see this view:

If you click on any link (I clicked on My note 2), you will see this view:

After this, we can add a menu in our Header component to access all our routes:

import React from 'react';import PropTypes from 'prop-types';import { Link } from 'react-router-dom'; ...

Get React Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.