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

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. 

主站蜘蛛池模板: 仪征市| 青岛市| 保亭| 阳泉市| 荥阳市| 乐清市| 舒兰市| 酒泉市| 韩城市| 临湘市| 祁东县| 溧水县| 申扎县| 仁寿县| 象山县| 五峰| 信宜市| 汉源县| 垣曲县| 安宁市| 云霄县| 南康市| 营山县| 长顺县| 色达县| 班玛县| 奈曼旗| 浦江县| 鄂托克前旗| 惠安县| 米易县| 海丰县| 绍兴市| 建始县| 云和县| 禄丰县| 武夷山市| 宁海县| 玉田县| 和田市| 东莞市|