You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was attempting to use Layout routes so I didn't have to import and wrap each route component into the same Layout component, but using a route object with breadcrumb properties and useRoutes, I get the following:
Unhandled Runtime Error
Error: useBreadcrumbs: `path` or `index` must be provided in every route object
Thanks for reporting @iainsimmons - I'm still getting up to speed with the v6 changes
The PageLayout route is admittedly weird. We call it a layout route because it doesn't participate in the matching at all (though its children do). It only exists to make wrapping multiple child routes in the same layout simpler. If we didn't allow this then you'd have to handle layouts in two different ways: sometimes your routes do it for you, sometimes you do it manually with lots of layout component repetition throughout your app:
So in this case it sounds like we expect use-react-router-breadcrumbsnot to require a path or index if children are present (meaning we can assume it's a LayoutRoute) - does that sound right?
Thanks for reporting @iainsimmons - I'm still getting up to speed with the v6 changes
The PageLayout route is admittedly weird. We call it a layout route because it doesn't participate in the matching at all (though its children do). It only exists to make wrapping multiple child routes in the same layout simpler. If we didn't allow this then you'd have to handle layouts in two different ways: sometimes your routes do it for you, sometimes you do it manually with lots of layout component repetition throughout your app:
So in this case it sounds like we expect use-react-router-breadcrumbsnot to require a path or index if children are present (meaning we can assume it's a LayoutRoute) - does that sound right?
I was attempting to use Layout routes so I didn't have to import and wrap each route component into the same Layout component, but using a route object with
breadcrumb
properties anduseRoutes
, I get the following:app.js
:components/breadcrumbs.js
The text was updated successfully, but these errors were encountered: