官术网_书友最值得收藏!

The sensitive prop

A <Route> component's path is not case-sensitive, that is, a <Route> component with its path prop value set to '/Dashboard' would match the '/dashboard' or '/DASHBOARD' URL path. To make a <Route> component's path case-sensitive, add the sensitive prop:

<Route
path="/Dashboard"
component={DashboardComponent}
sensitive
/>

The sensitive prop ensures that the path prop's case is taken into consideration when matching it with the browser's URL path. By adding the sensitive prop, one can define routes with the same pathname, but do so using a different case:

<Route
path="/Dashboard"
component={DashboardComponent}
sensitive
/>
<Route
path="/dashboard"
component={StockListComponent}
sensitive
/>

This code would create two distinct routes and would render the corresponding component when the <Route> component's case-sensitive path matches the browser's URL path. 

主站蜘蛛池模板: 沂源县| 鞍山市| 项城市| 建宁县| 陇川县| 汕头市| 方山县| 邵阳市| 巴马| 吉安县| 平武县| 桃园县| 天水市| 平原县| 许昌县| 云龙县| 绥德县| 新闻| 循化| 子长县| 会昌县| 台前县| 莲花县| 石门县| 黄陵县| 广元市| 乐陵市| 启东市| 邢台市| 鄂托克旗| 武邑县| 南靖县| 韶山市| 珠海市| 梅州市| 榆树市| 麦盖提县| 河南省| 永靖县| 会同县| 福鼎市|