- 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.
- Redis Applied Design Patterns
- Testing with JUnit
- Rust實戰
- 深入淺出Electron:原理、工程與實踐
- Magento 2 Development Cookbook
- 編譯系統透視:圖解編譯原理
- HDInsight Essentials(Second Edition)
- Gradle for Android
- Teaching with Google Classroom
- Android玩家必備
- Learning jQuery(Fourth Edition)
- Mapping with ArcGIS Pro
- Unity 5 Game Optimization
- 用Go語言自制編譯器
- Enterprise Application Architecture with .NET Core