File tree 3 files changed +15
-2
lines changed
3 files changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -140,7 +140,7 @@ Pathname | Result
140
140
Same as the example above using Declarative Routing.
141
141
142
142
```js
143
- import useBreadcrumbs, { createRoutesFromChildren } from ' use- react- router- breadcrumbs' ;
143
+ import useBreadcrumbs, { createRoutesFromChildren, Route } from ' use- react- router- breadcrumbs' ;
144
144
145
145
const userNamesById = { ' 1 ' : ' John' }
146
146
Original file line number Diff line number Diff line change 3
3
import React from 'react' ;
4
4
import PropTypes from 'prop-types' ;
5
5
import { mount } from 'enzyme' ;
6
- import { MemoryRouter as Router , Route , Routes } from 'react-router' ;
6
+ import { MemoryRouter as Router , Route } from 'react-router' ;
7
7
import useBreadcrumbs , { getBreadcrumbs , createRoutesFromChildren } from './index.tsx' ;
8
8
9
9
// imports to test compiled builds
Original file line number Diff line number Diff line change @@ -25,6 +25,9 @@ import {
25
25
Params ,
26
26
PathPattern ,
27
27
Route ,
28
+ PathRouteProps ,
29
+ LayoutRouteProps ,
30
+ IndexRouteProps ,
28
31
} from 'react-router' ;
29
32
30
33
type Location = ReturnType < typeof useLocation > ;
@@ -512,3 +515,13 @@ export function createRoutesFromChildren(
512
515
513
516
return routes ;
514
517
}
518
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
519
+ type BreadCrumb = { breadcrumb ?: string | ( ( param : any ) => JSX . Element ) | JSX . Element | null } ;
520
+
521
+ type BreadCrumbRouteType = (
522
+ _props : PathRouteProps | LayoutRouteProps | IndexRouteProps & BreadCrumb
523
+ ) => React . ReactElement | null ;
524
+
525
+ const BreadCrumbRoute : BreadCrumbRouteType = Route ;
526
+
527
+ export { BreadCrumbRoute as Route } ;
You can’t perform that action at this time.
0 commit comments