Skip to content

Commit 26e066c

Browse files
committed
readme
1 parent 38a4d8e commit 26e066c

File tree

1 file changed

+14
-29
lines changed

1 file changed

+14
-29
lines changed

README.md

Lines changed: 14 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -62,38 +62,23 @@ Pathname | Result
6262

6363
## API
6464

65-
#### withBreadcrumbs
6665
```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>
7080
```
7181

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-
9782
### Thanks
9883
- [Koan Inc.](https://koan.co)
9984
- [rjz](https://github.com/rjz)

0 commit comments

Comments
 (0)