Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 7a23c11

Browse filesBrowse files
authored
Merge pull request coreui#26 from coreui/dev-vnext
refactor(Breadcrumb): fix for dynamic url like /path/:id
2 parents 5c57508 + 969bd9c commit 7a23c11
Copy full SHA for 7a23c11

File tree

2 files changed

+5
-8
lines changed
Filter options

2 files changed

+5
-8
lines changed

‎package.json

Copy file name to clipboardExpand all lines: package.json
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@coreui/react",
3-
"version": "2.0.3",
3+
"version": "2.0.4",
44
"description": "CoreUI React Bootstrap 4 components",
55
"license": "MIT",
66
"author": {
@@ -38,7 +38,7 @@
3838
"@coreui/icons": "0.2.0",
3939
"classnames": "^2.2.6",
4040
"core-js": "^2.5.7",
41-
"prop-types": "^15.6.1",
41+
"prop-types": "^15.6.2",
4242
"react-perfect-scrollbar": "^1.1.1",
4343
"react-router-dom": "^4.3.1",
4444
"reactstrap": "^6.1.0"

‎src/Breadcrumb.js

Copy file name to clipboardExpand all lines: src/Breadcrumb.js
+3-6Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React, { Component } from 'react';
2-
import { Route, Link } from 'react-router-dom';
2+
import { Route, Link, matchPath } from 'react-router-dom';
33
import { Breadcrumb, BreadcrumbItem } from 'reactstrap';
44
import PropTypes from 'prop-types';
55
import classNames from 'classnames';
@@ -20,11 +20,8 @@ const getPaths = (pathname) => {
2020
};
2121

2222
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
2825
};
2926

3027
const BreadcrumbsItem = ({ match }) => {

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.