Answer the question
In order to leave comments, you need to log in
How to make breadcrumbs with react-router-dom?
We use react-router-dom in the application, maybe there is an article or an example for implementation, I will be very grateful
Answer the question
In order to leave comments, you need to log in
Try this simple solution:
const Breadcrumbs = ({ ...rest, match }) => (
<span>
<Link to={match.url || ''} className={match.isExact ? 'breadcrumb active' : 'breadcrumb'}>
{match.url.substr(match.url.lastIndexOf('/')+1, match.url.length)}
</Link>
<Route path={`${match.url}/:path`} component={Breadcrumbs} />
</span>
)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question