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

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. 

主站蜘蛛池模板: 苏州市| 沙田区| 辉县市| 吉林省| 荥经县| 崇明县| 永兴县| 会泽县| 松江区| 武胜县| 嘉义市| 鹰潭市| 巴南区| 疏勒县| 富锦市| 曲阜市| 南部县| 哈密市| 郎溪县| 黑龙江省| 广宁县| 贡觉县| 柞水县| 乐东| 东乌珠穆沁旗| 黄冈市| 榕江县| 嵩明县| 团风县| 临安市| 客服| 娱乐| 措美县| 上栗县| 定结县| 商河县| 高清| 西畴县| 林口县| 余庆县| 顺昌县|