-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for nested routes #24
Labels
Comments
Hey @janhartmann, thanks for the report! You're correct. Nested I should be able to add this soon! In the meantime, as a workaround, I'd suggest (not ideal, I know) maintaining 2 route configs like: const reactRouterConfig = [
{
path: '/',
component: () => <Redirect to='/projects' />,
exact: true,
breadcrumb: '',
},
{
path: '/projects',
component: ProjectListPage,
breadcrumb: 'My Projects',
exact: true,
},
{
path: '/projects/:projectId',
component: ProjectContainer,
breadcrumb: ({ match }) => match.params.projectId,
routes: [
{
path: '/projects/:projectId/discussions',
component: DiscussionsPage,
},
{
path: '/projects/:projectId/applications',
component: ApplicationsPage,
},
{
path: '/projects/:projectId/collaborators',
component: CollaboratorsPage,
},
],
},
];
const breadcrumbsConfig = [
{
path: '/projects/:projectId/discussions',
breadcrumb: 'Discussions',
},
{
path: '/projects/:projectId/applications',
breadcrumb: 'Applications',
},
{
path: '/projects/:projectId/collaborators',
breadcrumb: 'Collaborators',
},
];
withBreadcrumbs(reactRouterConfig.concat(breadcrumbsConfig))(Component); |
I can live with this for now! Thank you! ;-) |
This is now supported as of v |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks fo this, made my life easier for a breadcrumb navigation for a product I am working on! :-)
We have a routing structure like this:
And the HOC is working perfectly for the first level routes - the thing is that we have a nested
routes: [...]
which also contains breadcrumb, and they do not appear.Could the HOC be recursively by adding which prop to traverse for breadcrumbs?
All the best,
Jan
The text was updated successfully, but these errors were encountered: