@@ -41,7 +41,7 @@ function useDataRouterContext() {
41
41
let context = React . useContext ( DataRouterContext ) ;
42
42
invariant (
43
43
context ,
44
- "You must render this element inside a <DataRouterContext.Provider> element"
44
+ "You must render this element inside a <DataRouterContext.Provider> element" ,
45
45
) ;
46
46
return context ;
47
47
}
@@ -50,7 +50,7 @@ function useDataRouterStateContext() {
50
50
let context = React . useContext ( DataRouterStateContext ) ;
51
51
invariant (
52
52
context ,
53
- "You must render this element inside a <DataRouterStateContext.Provider> element"
53
+ "You must render this element inside a <DataRouterStateContext.Provider> element" ,
54
54
) ;
55
55
return context ;
56
56
}
@@ -67,7 +67,7 @@ export function useFrameworkContext(): FrameworkContextObject {
67
67
let context = React . useContext ( FrameworkContext ) ;
68
68
invariant (
69
69
context ,
70
- "You must render this element inside a <HydratedRouter> element"
70
+ "You must render this element inside a <HydratedRouter> element" ,
71
71
) ;
72
72
return context ;
73
73
}
@@ -103,7 +103,7 @@ interface PrefetchHandlers {
103
103
104
104
export function usePrefetchBehavior < T extends HTMLAnchorElement > (
105
105
prefetch : PrefetchBehavior ,
106
- theirElementProps : PrefetchHandlers
106
+ theirElementProps : PrefetchHandlers ,
107
107
) : [ boolean , React . RefObject < T > , PrefetchHandlers ] {
108
108
let frameworkContext = React . useContext ( FrameworkContext ) ;
109
109
let [ maybePrefetch , setMaybePrefetch ] = React . useState ( false ) ;
@@ -177,10 +177,10 @@ export function usePrefetchBehavior<T extends HTMLAnchorElement>(
177
177
}
178
178
179
179
export function composeEventHandlers <
180
- EventType extends React . SyntheticEvent | Event
180
+ EventType extends React . SyntheticEvent | Event ,
181
181
> (
182
182
theirHandler : ( ( event : EventType ) => any ) | undefined ,
183
- ourHandler : ( event : EventType ) => any
183
+ ourHandler : ( event : EventType ) => any ,
184
184
) : ( event : EventType ) => any {
185
185
return ( event ) => {
186
186
theirHandler && theirHandler ( event ) ;
@@ -198,7 +198,7 @@ export function composeEventHandlers<
198
198
function getActiveMatches (
199
199
matches : RouterState [ "matches" ] ,
200
200
errors : RouterState [ "errors" ] ,
201
- isSpaMode : boolean
201
+ isSpaMode : boolean ,
202
202
) {
203
203
if ( isSpaMode && ! isHydrated ) {
204
204
return [ matches [ 0 ] ] ;
@@ -247,7 +247,7 @@ export function Links(): React.JSX.Element {
247
247
248
248
let keyedLinks = React . useMemo (
249
249
( ) => getKeyedLinksForMatches ( matches , routeModules , manifest ) ,
250
- [ matches , routeModules , manifest ]
250
+ [ matches , routeModules , manifest ] ,
251
251
) ;
252
252
253
253
return (
@@ -270,7 +270,7 @@ export function Links(): React.JSX.Element {
270
270
< PrefetchPageLinks key = { key } { ...link } />
271
271
) : (
272
272
< link key = { key } { ...link } />
273
- )
273
+ ) ,
274
274
) }
275
275
</ >
276
276
) ;
@@ -307,7 +307,7 @@ export function PrefetchPageLinks({
307
307
let { router } = useDataRouterContext ( ) ;
308
308
let matches = React . useMemo (
309
309
( ) => matchRoutes ( router . routes , page , router . basename ) ,
310
- [ router . routes , page , router . basename ]
310
+ [ router . routes , page , router . basename ] ,
311
311
) ;
312
312
313
313
if ( ! matches ) {
@@ -334,7 +334,7 @@ function useKeyedPrefetchLinks(matches: AgnosticDataRouteMatch[]) {
334
334
if ( ! interrupted ) {
335
335
setKeyedPrefetchLinks ( links ) ;
336
336
}
337
- }
337
+ } ,
338
338
) ;
339
339
340
340
return ( ) => {
@@ -365,9 +365,9 @@ function PrefetchPageLinksImpl({
365
365
matches ,
366
366
manifest ,
367
367
location ,
368
- "data"
368
+ "data" ,
369
369
) ,
370
- [ page , nextMatches , matches , manifest , location ]
370
+ [ page , nextMatches , matches , manifest , location ] ,
371
371
) ;
372
372
373
373
let newMatchesForAssets = React . useMemo (
@@ -378,9 +378,9 @@ function PrefetchPageLinksImpl({
378
378
matches ,
379
379
manifest ,
380
380
location ,
381
- "assets"
381
+ "assets" ,
382
382
) ,
383
- [ page , nextMatches , matches , manifest , location ]
383
+ [ page , nextMatches , matches , manifest , location ] ,
384
384
) ;
385
385
386
386
let dataHrefs = React . useMemo ( ( ) => {
@@ -427,7 +427,7 @@ function PrefetchPageLinksImpl({
427
427
nextMatches
428
428
. filter ( ( m ) => routesParams . has ( m . route . id ) )
429
429
. map ( ( m ) => m . route . id )
430
- . join ( "," )
430
+ . join ( "," ) ,
431
431
) ;
432
432
}
433
433
@@ -445,7 +445,7 @@ function PrefetchPageLinksImpl({
445
445
446
446
let moduleHrefs = React . useMemo (
447
447
( ) => getModuleLinkHrefs ( newMatchesForAssets , manifest ) ,
448
- [ newMatchesForAssets , manifest ]
448
+ [ newMatchesForAssets , manifest ] ,
449
449
) ;
450
450
451
451
// needs to be a hook with async behavior because we need the modules, not
@@ -541,8 +541,8 @@ export function Meta(): React.JSX.Element {
541
541
error,
542
542
} )
543
543
: Array . isArray ( routeModule . meta )
544
- ? [ ...routeModule . meta ]
545
- : routeModule . meta ;
544
+ ? [ ...routeModule . meta ]
545
+ : routeModule . meta ;
546
546
} else if ( leafMeta ) {
547
547
// We only assign the route's meta to the nearest leaf if there is no meta
548
548
// export in the route. The meta function may return a falsy value which
@@ -557,7 +557,7 @@ export function Meta(): React.JSX.Element {
557
557
_match . route . path +
558
558
" returns an invalid value. All route meta functions must " +
559
559
"return an array of meta objects." +
560
- "\n\nTo reference the meta function API, see https://remix.run/route/meta"
560
+ "\n\nTo reference the meta function API, see https://remix.run/route/meta" ,
561
561
) ;
562
562
}
563
563
@@ -578,7 +578,7 @@ export function Meta(): React.JSX.Element {
578
578
let { tagName, ...rest } = metaProps ;
579
579
if ( ! isValidMetaTag ( tagName ) ) {
580
580
console . warn (
581
- `A meta object uses an invalid tagName: ${ tagName } . Expected either 'link' or 'meta'`
581
+ `A meta object uses an invalid tagName: ${ tagName } . Expected either 'link' or 'meta'` ,
582
582
) ;
583
583
return null ;
584
584
}
@@ -809,7 +809,7 @@ ${matches
809
809
`window.__reactRouterManifest = ${ JSON . stringify (
810
810
getPartialManifest ( manifest , router ) ,
811
811
null ,
812
- 2
812
+ 2 ,
813
813
) } ;`
814
814
: ""
815
815
}
@@ -849,15 +849,15 @@ import(${JSON.stringify(manifest.entry.module)});`;
849
849
manifest . entry . imports . concat (
850
850
getModuleLinkHrefs ( matches , manifest , {
851
851
includeHydrateFallback : true ,
852
- } )
853
- )
852
+ } ) ,
853
+ ) ,
854
854
) ;
855
855
856
856
let sri = typeof manifest . sri === "object" ? manifest . sri : { } ;
857
857
858
858
warnOnce (
859
859
! isRSCRouterContext ,
860
- "The <Scripts /> element is a no-op when using RSC and can be safely removed."
860
+ "The <Scripts /> element is a no-op when using RSC and can be safely removed." ,
861
861
) ;
862
862
863
863
return isHydrated || isRSCRouterContext ? null : (
0 commit comments