File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -102,15 +102,17 @@ export function useRouteState<T extends {}>(key: string, initial: T) {
102
102
103
103
export const RouterHost = ( {
104
104
children,
105
+ normalizeUrl = ( url : string ) => url ,
105
106
Shell,
106
107
onRouteUpdated,
107
108
} : {
108
109
children : React . ReactElement ;
110
+ normalizeUrl ?: ( url : string ) => string ;
109
111
Shell : React . ComponentType < { children : React . ReactElement ; route ?: string } > ;
110
112
onRouteUpdated ?: ( path : string ) => void ;
111
113
} ) => {
112
114
const pathname = useLocationProperty (
113
- ( ) => location . pathname + location . search ,
115
+ ( ) => normalizeUrl ( location . pathname + location . search ) ,
114
116
( ) => globalX . __INITIAL_ROUTE__
115
117
) ;
116
118
const [ current , setCurrent ] = useState ( children ) ;
You can’t perform that action at this time.
0 commit comments