Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
ASP.NET Core 3 and React

You're reading from   ASP.NET Core 3 and React Hands-On full stack web development using ASP.NET Core, React, and TypeScript 3

Arrow left icon
Product type Paperback
Published in Dec 2019
Publisher Packt
ISBN-13 9781789950229
Length 598 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Authors (2):
Arrow left icon
Jason Watmore Jason Watmore
Author Profile Icon Jason Watmore
Jason Watmore
Carl Rippon Carl Rippon
Author Profile Icon Carl Rippon
Carl Rippon
Arrow right icon
View More author details
Toc

Table of Contents (22) Chapters Close

Preface 1. Section 1: Getting Started FREE CHAPTER
2. Understanding the ASP.NET Core React Template 3. Creating Decoupled React and ASP.NET Core Apps 4. Section 2: Building a Frontend with React and TypeScript
5. Getting Started with React and TypeScript 6. Routing with React Router 7. Working with Forms 8. Managing State with Redux 9. Section 3: Building an ASP.NET Core Backend
10. Interacting with the Database with Dapper 11. Creating REST API Endpoints 12. Creating a Real-Time API with SignalR 13. Improving Performance and Scalability 14. Securing the Backend 15. Interacting with RESTful APIs 16. Section 4: Moving into Production
17. Adding Automated Tests 18. Configuring and Deploying to Azure 19. Implementing CI and CD with Azure DevOps 20. Assessments 21. Other Books You May Enjoy

Handling routes not found

In this section, we'll handle paths that aren't handled by any of the Route components. By following these steps, we'll start by understanding what happens if we put an unhandled path in the browser:

  1. Enter a path that isn't handled in the browser and see what happens:

So, nothing is rendered beneath the header when we browse to a path that isn't handled by a Route component. This makes sense if we think about it.

  1. We'd like to improve the user experience of routes not found and inform the user that this is the case. Let's add the following highlighted route inside the Switch component:
<Switch>
<Redirect from="/home" to="/" />
<Route exact path="/" component={HomePage} />
<Route path="/search" component={SearchPage} />
<Route path="/ask...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime