react-router-breadcrumbs icon indicating copy to clipboard operation
react-router-breadcrumbs copied to clipboard

Reasonable default if no name is provided?

Open bjdmeest opened this issue 8 years ago • 2 comments

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'

bjdmeest avatar Jan 16 '17 14:01 bjdmeest

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. :)

nutgaard avatar Jan 16 '17 15:01 nutgaard

Thanks! Sorry for missing that in the documentation :)

bjdmeest avatar Jan 16 '17 15:01 bjdmeest