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

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. 

主站蜘蛛池模板: 陵水| 冕宁县| 贵州省| 岐山县| 丹阳市| 陇南市| 微博| 吴川市| 石楼县| 奈曼旗| 灵璧县| 绵竹市| 贵南县| 肇州县| 淮滨县| 肇庆市| 弋阳县| 惠州市| 塔城市| 秦皇岛市| 姜堰市| 邳州市| 蓬莱市| 阿拉善左旗| 榕江县| 绿春县| 临高县| 资兴市| 玉门市| 仁化县| 海宁市| 海晏县| 泰来县| 邻水| 集安市| 武宣县| 视频| 孟州市| 克什克腾旗| 南充市| 昔阳县|