- React Router Quick Start Guide
- Sagar Ganatra
- 200字
- 2021-07-23 16:41:33
The strict prop
When the <Route> path has a trailing slash, and you would like to match this path, including the trailing slash, with the browser's URL, then include the strict prop. For example, after changing the <Route> path from '/dashboard' to '/dashboard/', the <Route> component would still match the URL path without the trailing slash. In other words, '/dashboard' would match the <Route> component with the '/dashboard/' path.
However, after adding the strict prop, React-Router ensures that <Route> matches only if the URL has a trailing slash:
<Route
path="/dashboard/"
component={DashboardComponent}
strict
/>
With this <Route> configuration in place, the '/dashboard' path would not match. However, when you add a trailing slash to the URL, as in '/dashboard/', the <Route> component with a strict prop will match and the DashboardComponent would be rendered.
- 演進式架構(原書第2版)
- Python入門很簡單
- Xcode 7 Essentials(Second Edition)
- VMware vSphere 6.7虛擬化架構實戰指南
- C++ 從入門到項目實踐(超值版)
- UML 基礎與 Rose 建模案例(第3版)
- PrimeFaces Blueprints
- Python開發基礎
- INSTANT JQuery Flot Visual Data Analysis
- PHP Microservices
- SQL Server 2014 Development Essentials
- Pandas 1.x Cookbook
- Node.js Web Development
- Server Side development with Node.js and Koa.js Quick Start Guide
- SAP HANA Cookbook