React Router

React, unlike Angular, is a library instead of a framework, meaning specific functionalities (for example, routing or PropTypes) are not part of the React Core. Instead, routing is handled by a third-party library called React Router.

In this chapter, you will see how to implement React Router in your application, and by the end of the relevant sections, you will be able to add dynamic routes and understand how React Router works.

In this chapter, we will cover the following topics:

  • Understanding the differences between the react-router, react-router-dom, and react-router-native packages
  • How to install and configure React Router
  • Adding the <Switch> component
  • Adding the exact property
  • Adding parameters to the routes

Technical ...

Get React 17 Design Patterns and Best Practices - Third Edition 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.