nutgaard / react-router-breadcrumbs

Breadcrumb component for react-router
Other
46 stars 11 forks source link

Reasonable default if no name is provided? #229

Open bjdmeest opened 7 years ago

bjdmeest commented 7 years ago

Right now, react-router-breadcrumbs prevents rendering if no name is provided to a route. I know that error is my fault ;), but maybe it would make sense provide a more reasonable default if no name is provided?

More specifically, maybe changing https://github.com/nutgaard/react-router-breadcrumbs/blob/master/src/breadcrumbs.js#L19 into something like: var text = route.breadcrumbName || route.name || (route.component && route.component.name) || route.path || 'Unknown'

nutgaard commented 7 years ago

Hi, and thanks for reporting this issue.

I've already commented this here; https://github.com/nutgaard/react-router-breadcrumbs#undocumented--todo

But I'll add the Unknown fallback as soon as I can. :)

bjdmeest commented 7 years ago

Thanks! Sorry for missing that in the documentation :)