File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed
packages/reactant-router-dom/src Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change 11import pathToRegexp from 'path-to-regexp' ;
22import type * as ReactRouterDom from 'react-router-dom' ;
3+ import type { ExtractRouteParams } from 'react-router' ;
34
45const cache : Record < string , pathToRegexp . PathFunction > = { } ;
56const cacheLimit = 10000 ;
@@ -20,11 +21,9 @@ const compilePath = (path: string) => {
2021
2122export const generatePath : typeof ReactRouterDom . generatePath = < S extends string > (
2223 path : S = '/' as S ,
23- params ?: ReactRouterDom . ExtractRouteParams < S , string | number | boolean >
24+ params ?: ExtractRouteParams < S , string | number | boolean >
2425) => {
25- const nextParams =
26- params ??
27- ( { } as ReactRouterDom . ExtractRouteParams < S , string | number | boolean > ) ;
26+ const nextParams = params ?? ( { } as ExtractRouteParams < S , string | number | boolean > ) ;
2827
2928 return path === '/' ? path : compilePath ( path ) ( nextParams , { pretty : true } ) ;
3029} ;
You can’t perform that action at this time.
0 commit comments