Fix breadcrumbName replace (#1797)

pull/2007/head
afc163 9 years ago
parent 74ef0b7951
commit 4b05250a6b

@ -5,8 +5,10 @@ const defaultNameRender = (breadcrumbName, route, params) => {
if (!breadcrumbName) {
return null;
}
const paramsKeys = Object.keys(params).join('|');
const name = breadcrumbName.replace(
/:(.*)/g, (replacement, key) => params[key] || replacement
new RegExp(`:(${paramsKeys})`, 'g'),
(replacement, key) => params[key] || replacement
);
return <span>{name}</span>;
};

Loading…
Cancel
Save