Skip to content

Commit 15e9a9e

Browse files
committed
chore: format
1 parent 5bbbc9d commit 15e9a9e

File tree

1 file changed

+25
-25
lines changed

1 file changed

+25
-25
lines changed

packages/react-router/lib/dom/ssr/components.tsx

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ function useDataRouterContext() {
4141
let context = React.useContext(DataRouterContext);
4242
invariant(
4343
context,
44-
"You must render this element inside a <DataRouterContext.Provider> element"
44+
"You must render this element inside a <DataRouterContext.Provider> element",
4545
);
4646
return context;
4747
}
@@ -50,7 +50,7 @@ function useDataRouterStateContext() {
5050
let context = React.useContext(DataRouterStateContext);
5151
invariant(
5252
context,
53-
"You must render this element inside a <DataRouterStateContext.Provider> element"
53+
"You must render this element inside a <DataRouterStateContext.Provider> element",
5454
);
5555
return context;
5656
}
@@ -67,7 +67,7 @@ export function useFrameworkContext(): FrameworkContextObject {
6767
let context = React.useContext(FrameworkContext);
6868
invariant(
6969
context,
70-
"You must render this element inside a <HydratedRouter> element"
70+
"You must render this element inside a <HydratedRouter> element",
7171
);
7272
return context;
7373
}
@@ -103,7 +103,7 @@ interface PrefetchHandlers {
103103

104104
export function usePrefetchBehavior<T extends HTMLAnchorElement>(
105105
prefetch: PrefetchBehavior,
106-
theirElementProps: PrefetchHandlers
106+
theirElementProps: PrefetchHandlers,
107107
): [boolean, React.RefObject<T>, PrefetchHandlers] {
108108
let frameworkContext = React.useContext(FrameworkContext);
109109
let [maybePrefetch, setMaybePrefetch] = React.useState(false);
@@ -177,10 +177,10 @@ export function usePrefetchBehavior<T extends HTMLAnchorElement>(
177177
}
178178

179179
export function composeEventHandlers<
180-
EventType extends React.SyntheticEvent | Event
180+
EventType extends React.SyntheticEvent | Event,
181181
>(
182182
theirHandler: ((event: EventType) => any) | undefined,
183-
ourHandler: (event: EventType) => any
183+
ourHandler: (event: EventType) => any,
184184
): (event: EventType) => any {
185185
return (event) => {
186186
theirHandler && theirHandler(event);
@@ -198,7 +198,7 @@ export function composeEventHandlers<
198198
function getActiveMatches(
199199
matches: RouterState["matches"],
200200
errors: RouterState["errors"],
201-
isSpaMode: boolean
201+
isSpaMode: boolean,
202202
) {
203203
if (isSpaMode && !isHydrated) {
204204
return [matches[0]];
@@ -247,7 +247,7 @@ export function Links(): React.JSX.Element {
247247

248248
let keyedLinks = React.useMemo(
249249
() => getKeyedLinksForMatches(matches, routeModules, manifest),
250-
[matches, routeModules, manifest]
250+
[matches, routeModules, manifest],
251251
);
252252

253253
return (
@@ -270,7 +270,7 @@ export function Links(): React.JSX.Element {
270270
<PrefetchPageLinks key={key} {...link} />
271271
) : (
272272
<link key={key} {...link} />
273-
)
273+
),
274274
)}
275275
</>
276276
);
@@ -307,7 +307,7 @@ export function PrefetchPageLinks({
307307
let { router } = useDataRouterContext();
308308
let matches = React.useMemo(
309309
() => matchRoutes(router.routes, page, router.basename),
310-
[router.routes, page, router.basename]
310+
[router.routes, page, router.basename],
311311
);
312312

313313
if (!matches) {
@@ -334,7 +334,7 @@ function useKeyedPrefetchLinks(matches: AgnosticDataRouteMatch[]) {
334334
if (!interrupted) {
335335
setKeyedPrefetchLinks(links);
336336
}
337-
}
337+
},
338338
);
339339

340340
return () => {
@@ -365,9 +365,9 @@ function PrefetchPageLinksImpl({
365365
matches,
366366
manifest,
367367
location,
368-
"data"
368+
"data",
369369
),
370-
[page, nextMatches, matches, manifest, location]
370+
[page, nextMatches, matches, manifest, location],
371371
);
372372

373373
let newMatchesForAssets = React.useMemo(
@@ -378,9 +378,9 @@ function PrefetchPageLinksImpl({
378378
matches,
379379
manifest,
380380
location,
381-
"assets"
381+
"assets",
382382
),
383-
[page, nextMatches, matches, manifest, location]
383+
[page, nextMatches, matches, manifest, location],
384384
);
385385

386386
let dataHrefs = React.useMemo(() => {
@@ -427,7 +427,7 @@ function PrefetchPageLinksImpl({
427427
nextMatches
428428
.filter((m) => routesParams.has(m.route.id))
429429
.map((m) => m.route.id)
430-
.join(",")
430+
.join(","),
431431
);
432432
}
433433

@@ -445,7 +445,7 @@ function PrefetchPageLinksImpl({
445445

446446
let moduleHrefs = React.useMemo(
447447
() => getModuleLinkHrefs(newMatchesForAssets, manifest),
448-
[newMatchesForAssets, manifest]
448+
[newMatchesForAssets, manifest],
449449
);
450450

451451
// needs to be a hook with async behavior because we need the modules, not
@@ -541,8 +541,8 @@ export function Meta(): React.JSX.Element {
541541
error,
542542
})
543543
: Array.isArray(routeModule.meta)
544-
? [...routeModule.meta]
545-
: routeModule.meta;
544+
? [...routeModule.meta]
545+
: routeModule.meta;
546546
} else if (leafMeta) {
547547
// We only assign the route's meta to the nearest leaf if there is no meta
548548
// export in the route. The meta function may return a falsy value which
@@ -557,7 +557,7 @@ export function Meta(): React.JSX.Element {
557557
_match.route.path +
558558
" returns an invalid value. All route meta functions must " +
559559
"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",
561561
);
562562
}
563563

@@ -578,7 +578,7 @@ export function Meta(): React.JSX.Element {
578578
let { tagName, ...rest } = metaProps;
579579
if (!isValidMetaTag(tagName)) {
580580
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'`,
582582
);
583583
return null;
584584
}
@@ -809,7 +809,7 @@ ${matches
809809
`window.__reactRouterManifest = ${JSON.stringify(
810810
getPartialManifest(manifest, router),
811811
null,
812-
2
812+
2,
813813
)};`
814814
: ""
815815
}
@@ -849,15 +849,15 @@ import(${JSON.stringify(manifest.entry.module)});`;
849849
manifest.entry.imports.concat(
850850
getModuleLinkHrefs(matches, manifest, {
851851
includeHydrateFallback: true,
852-
})
853-
)
852+
}),
853+
),
854854
);
855855

856856
let sri = typeof manifest.sri === "object" ? manifest.sri : {};
857857

858858
warnOnce(
859859
!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.",
861861
);
862862

863863
return isHydrated || isRSCRouterContext ? null : (

0 commit comments

Comments
 (0)