Skip to content

Commit 7523a38

Browse files
authored
Update README.md
1 parent 7d1d6e9 commit 7523a38

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,16 @@ const DynamicUserBreadcrumb = ({ match }) => (
9696
<span>{userNamesById[match.params.userId]}</span>
9797
);
9898

99+
const CustomPropsBreadcrumb = ({ someProp }) => (
100+
<span>{someProp}</span>
101+
);
102+
99103
// define custom breadcrumbs for certain routes.
100104
// breadcumbs can be components or strings.
101105
const routes = [
102106
{ path: '/users/:userId', breadcrumb: DynamicUserBreadcrumb },
103107
{ path: '/example', breadcrumb: 'Custom Example' },
108+
{ path: '/custom-props, breadcrumb: CustomPropsBreadcrumb, props: { someProp: 'Hi' }},
104109
];
105110
106111
// map & render your breadcrumb components however you want.
@@ -129,6 +134,7 @@ Pathname | Result
129134
/users | Home / Users
130135
/users/1 | Home / Users / John
131136
/example | Home / Custom Example
137+
/custom-props | Home / Hi
132138
133139
## [Route object](https://reactrouter.com/docs/en/v6/examples/route-objects) compatibility
134140

0 commit comments

Comments
 (0)