@@ -53,7 +53,10 @@ export const RouterContextObj = createContext<RouterContext>();
53
53
export const RouteContextObj = createContext < RouteContext > ( ) ;
54
54
55
55
export 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
+ ) ;
57
60
58
61
let TempRoute : RouteContext | undefined ;
59
62
export const useRoute = ( ) => TempRoute || useContext ( RouteContextObj ) || useRouter ( ) . base ;
@@ -270,7 +273,7 @@ export function createRouterContext(
270
273
integration : RouterIntegration ,
271
274
getContext ?: ( ) => any ,
272
275
getBranches ?: ( ) => Branch [ ] ,
273
- options : { base ?: string , singleFlight ?: boolean } = { }
276
+ options : { base ?: string ; singleFlight ?: boolean } = { }
274
277
) : RouterContext {
275
278
const {
276
279
signal : [ source , setSource ] ,
@@ -464,7 +467,9 @@ export function createRouterContext(
464
467
465
468
function initFromFlash ( ) {
466
469
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 > > ;
468
473
}
469
474
}
470
475
0 commit comments