- 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.
- OpenCV實例精解
- PowerCLI Cookbook
- 羅克韋爾ControlLogix系統(tǒng)應用技術(shù)
- Learning Neo4j 3.x(Second Edition)
- SQL基礎教程(視頻教學版)
- QGIS By Example
- Visual C++開發(fā)入行真功夫
- C#程序設計教程(第3版)
- Quantum Computing and Blockchain in Business
- Scala for Machine Learning(Second Edition)
- Mastering Web Application Development with AngularJS
- 區(qū)塊鏈技術(shù)進階與實戰(zhàn)(第2版)
- Python趣味編程與精彩實例
- Hacking Android
- TypeScript High Performance