File tree Expand file tree Collapse file tree 1 file changed +14
-29
lines changed Expand file tree Collapse file tree 1 file changed +14
-29
lines changed Original file line number Diff line number Diff line change @@ -62,38 +62,23 @@ Pathname | Result
62
62
63
63
## API
64
64
65
- #### withBreadcrumbs
66
65
``` js
67
- import { withBreadcrumbs } from ' react-router-breadcrumbs-hoc' ;
68
-
69
- withBreadcrumbs (routes)(Component): HigherOrderComponent
66
+ Route = {
67
+ path: String
68
+ breadcrumb: String | Function
69
+ matchOptions?: Object
70
+ }
71
+
72
+ Breadcrumb = {
73
+ path: String
74
+ match: String
75
+ breadcrumb: Component
76
+ }
77
+
78
+ withBreadcrumbs (routes: Array < Route> ): HigherOrderComponent
79
+ getBreadcrumbs ({ routes: Array < Route> , pathname: String }): Array < Breadcrumb>
70
80
```
71
81
72
- ---
73
-
74
- #### route
75
-
76
- Param | Type | Default | Required
77
- --- | --- | --- | ---
78
- path | String | null | Required
79
- breadcrumb | String or Function (component) | null | Required
80
- matchOptions | Object | { exact: true } | Optional
81
-
82
- ---
83
-
84
- #### getBreadcrumbs
85
- If you don't want to use the HOC the ` getBreadcrumbs ` method is available to use instead.
86
-
87
- ``` js
88
- import { getBreadcrumbs } from ' react-router-breadcrumbs-hoc' ;
89
-
90
- getBreadcrumbs ({
91
- routes,
92
- pathname,
93
- }): breadcrumbs: Array < object> { breadcrumb, path, match }
94
- ```
95
-
96
-
97
82
### Thanks
98
83
- [ Koan Inc.] ( https://koan.co )
99
84
- [ rjz] ( https://github.com/rjz )
You can’t perform that action at this time.
0 commit comments