File tree
Expand file treeCollapse file tree2 files changed
+5
-8
lines changed Expand file treeCollapse file tree2 files changed
+5
-8
lines changed Original file line number | Diff line number | Diff line change |
---|
|
1 | 1 | {
|
2 | 2 | "name": "@coreui/react",
|
3 |
| -"version": "2.0.3", |
| 3 | +"version": "2.0.4", |
4 | 4 | "description": "CoreUI React Bootstrap 4 components",
|
5 | 5 | "license": "MIT",
|
6 | 6 | "author": {
|
|
38 | 38 | "@coreui/icons": "0.2.0",
|
39 | 39 | "classnames": "^2.2.6",
|
40 | 40 | "core-js": "^2.5.7",
|
41 |
| -"prop-types": "^15.6.1", |
| 41 | +"prop-types": "^15.6.2", |
42 | 42 | "react-perfect-scrollbar": "^1.1.1",
|
43 | 43 | "react-router-dom": "^4.3.1",
|
44 | 44 | "reactstrap": "^6.1.0"
|
|
Original file line number | Diff line number | Diff line change |
---|
|
1 | 1 | import React, { Component } from 'react';
|
2 |
| -import { Route, Link } from 'react-router-dom'; |
| 2 | +import { Route, Link, matchPath } from 'react-router-dom'; |
3 | 3 | import { Breadcrumb, BreadcrumbItem } from 'reactstrap';
|
4 | 4 | import PropTypes from 'prop-types';
|
5 | 5 | import classNames from 'classnames';
|
@@ -20,11 +20,8 @@ const getPaths = (pathname) => {
|
20 | 20 | };
|
21 | 21 |
|
22 | 22 | const findRouteName = (url) => {
|
23 |
| -const aroute = routes.find(route => route.path === url); |
24 |
| -if (aroute && aroute.name) { |
25 |
| -return aroute.name; |
26 |
| -} |
27 |
| -return null; |
| 23 | +const aroute = routes.find(route => matchPath(url, {path: route.path, exact: route.exact})); |
| 24 | +return (aroute && aroute.name) ? aroute.name : null |
28 | 25 | };
|
29 | 26 |
|
30 | 27 | const BreadcrumbsItem = ({ match }) => {
|
|
You can’t perform that action at this time.
0 commit comments