use-react-router-breadcrumbs
use-react-router-breadcrumbs copied to clipboard
Ability to have react components for the default formatter?
Well I wish to use as default formatting not a <span> object but rather a <Link> (from material ui) component that has a specific calculation like:
const BreadCrumbDefault = observer(function(props: BreadcrumbComponentProps) {
const fin = props.match.pathname.lastIndexOf('/')
const rt = props.match.pathname.substring(fin + 1) || 'home'
return <Link underline="hover"
href={props.match.pathname}
color="inherit">
{rt}
</Link>;
});
```
Hi @pulli23 - because this utility returns an array, you should be able to render the breadcrumbs however you want. I suggest using Link in the map like the advanced example in the docs uses NavLink?