Chapter 5: Routing with React Router

So far, our Q&A app only contains one page, so the time has come to add more pages to the app. In Chapter 1, Understanding the ASP.NET 5 React Template, we learned that pages in a Single Page Application (SPA) are constructed in the browser without any request for the HTML to the server.

React Router is a great library that helps us to implement client-side pages and the navigation between them. So, we are going to bring it into our project in this chapter.

In this chapter, we will declaratively define the routes that are available in our app. We learn how to provide feedback to users when they navigate to paths that don't exist. We'll implement a page that displays the details of a question, along with ...

Get ASP.NET Core 5 and React - Second 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.