File tree 1 file changed +11
-8
lines changed
1 file changed +11
-8
lines changed Original file line number Diff line number Diff line change @@ -39,9 +39,16 @@ const CBreadcrumbRouter = props => {
39
39
...attributes
40
40
} = props ;
41
41
42
- const currPath = useLocation ( ) . pathname
43
- const paths = getPaths ( currPath )
44
- const currRoutes = routes . filter ( route => paths . includes ( route . path ) )
42
+ let items = null
43
+ if ( routes ) {
44
+ const currPath = useLocation ( ) . pathname
45
+ const paths = getPaths ( currPath )
46
+ const currRoutes = routes . filter ( route => paths . includes ( route . path ) )
47
+ items = currRoutes . map ( route => {
48
+ return CBreadcrumbRouteItem ( route , currPath )
49
+ } )
50
+ }
51
+
45
52
46
53
//render
47
54
@@ -53,11 +60,7 @@ const CBreadcrumbRouter = props => {
53
60
{ ...attributes }
54
61
ref = { innerRef }
55
62
>
56
- {
57
- currRoutes . map ( route => {
58
- return CBreadcrumbRouteItem ( route , currPath )
59
- } )
60
- }
63
+ { items }
61
64
</ CBreadcrumb >
62
65
)
63
66
}
You can’t perform that action at this time.
0 commit comments