Check out example codes for "react exact path highlight". It will help you in understanding the concepts better.

Code Example 1

nav ul {
  list-style: none;
  display: flex;
  background-color: black;
  margin-bottom: 20px;
}

nav ul li {
  padding: 20px;
}

nav ul li a {
  color: white;
  text-decoration: none;
}

.current {
  border-bottom: 4px solid white;
}

Learn ReactJs, React Native from akashmittal.com