@@ -53,7 +53,10 @@ export const RouterContextObj = createContext<RouterContext>();
5353export const RouteContextObj = createContext < RouteContext > ( ) ;
5454
5555export const useRouter = ( ) =>
56- invariant ( useContext ( RouterContextObj ) , "<A> and 'use' router primitives can be only used inside a Route." ) ;
56+ invariant (
57+ useContext ( RouterContextObj ) ,
58+ "<A> and 'use' router primitives can be only used inside a Route."
59+ ) ;
5760
5861let TempRoute : RouteContext | undefined ;
5962export const useRoute = ( ) => TempRoute || useContext ( RouteContextObj ) || useRouter ( ) . base ;
@@ -270,7 +273,7 @@ export function createRouterContext(
270273 integration : RouterIntegration ,
271274 getContext ?: ( ) => any ,
272275 getBranches ?: ( ) => Branch [ ] ,
273- options : { base ?: string , singleFlight ?: boolean } = { }
276+ options : { base ?: string ; singleFlight ?: boolean } = { }
274277) : RouterContext {
275278 const {
276279 signal : [ source , setSource ] ,
@@ -464,7 +467,9 @@ export function createRouterContext(
464467
465468 function initFromFlash ( ) {
466469 const e = getRequestEvent ( ) ;
467- return e && e . router && e . router . submission ? [ e . router . submission ] : [ ] ;
470+ return ( e && e . router && e . router . submission
471+ ? [ e . router . submission ]
472+ : [ ] ) as Array < Submission < any , any > > ;
468473 }
469474}
470475
0 commit comments