Skip to content

Commit c6fe178

Browse files
fix: normalize links functions (#183)
1 parent 8367d86 commit c6fe178

File tree

30 files changed

+106
-125
lines changed

30 files changed

+106
-125
lines changed

_official-jokes/app/root.tsx

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,19 @@ import globalLargeStylesUrl from "./styles/global-large.css";
1212
import globalMediumStylesUrl from "./styles/global-medium.css";
1313
import globalStylesUrl from "./styles/global.css";
1414

15-
export const links: LinksFunction = () => {
16-
return [
17-
{ rel: "stylesheet", href: globalStylesUrl },
18-
{
19-
rel: "stylesheet",
20-
href: globalMediumStylesUrl,
21-
media: "print, (min-width: 640px)",
22-
},
23-
{
24-
rel: "stylesheet",
25-
href: globalLargeStylesUrl,
26-
media: "screen and (min-width: 1024px)",
27-
},
28-
];
29-
};
15+
export const links: LinksFunction = () => [
16+
{ rel: "stylesheet", href: globalStylesUrl },
17+
{
18+
rel: "stylesheet",
19+
href: globalMediumStylesUrl,
20+
media: "print, (min-width: 640px)",
21+
},
22+
{
23+
rel: "stylesheet",
24+
href: globalLargeStylesUrl,
25+
media: "screen and (min-width: 1024px)",
26+
},
27+
];
3028

3129
export const meta: MetaFunction = () => {
3230
const description = `Learn Remix and laugh at the same time!`;

_official-jokes/app/routes/index.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ export const meta: MetaFunction = () => {
1010
};
1111
};
1212

13-
export const links: LinksFunction = () => {
14-
return [{ rel: "stylesheet", href: stylesUrl }];
15-
};
13+
export const links: LinksFunction = () => [
14+
{ rel: "stylesheet", href: stylesUrl },
15+
];
1616

1717
export default function Index() {
1818
return (

basic/app/root.tsx

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,15 @@ import globalStylesUrl from "~/styles/global.css";
2424
*
2525
* https://remix.run/route/links
2626
*/
27-
export const links: LinksFunction = () => {
28-
return [
29-
{ rel: "stylesheet", href: globalStylesUrl },
30-
{
31-
rel: "stylesheet",
32-
href: darkStylesUrl,
33-
media: "(prefers-color-scheme: dark)",
34-
},
35-
{ rel: "stylesheet", href: deleteMeRemixStyles },
36-
];
37-
};
27+
export const links: LinksFunction = () => [
28+
{ rel: "stylesheet", href: globalStylesUrl },
29+
{
30+
rel: "stylesheet",
31+
href: darkStylesUrl,
32+
media: "(prefers-color-scheme: dark)",
33+
},
34+
{ rel: "stylesheet", href: deleteMeRemixStyles },
35+
];
3836

3937
export const meta: MetaFunction = () => ({
4038
charset: "utf-8",

basic/app/routes/demos/about.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ export const meta: MetaFunction = () => {
99
};
1010
};
1111

12-
export const links: LinksFunction = () => {
13-
return [{ rel: "stylesheet", href: stylesUrl }];
14-
};
12+
export const links: LinksFunction = () => [
13+
{ rel: "stylesheet", href: stylesUrl },
14+
];
1515

1616
export default function Index() {
1717
return (

client-side-validation/app/root.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ import {
1212

1313
import stylesUrl from "./index.css";
1414

15-
export const links: LinksFunction = () => {
16-
return [{ rel: "stylesheet", href: stylesUrl }];
17-
};
15+
export const links: LinksFunction = () => [
16+
{ rel: "stylesheet", href: stylesUrl },
17+
];
1818

1919
export const meta: MetaFunction = () => ({
2020
charset: "utf-8",

combobox-resource-route/app/root.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { MetaFunction } from "@remix-run/node";
1+
import type { LinksFunction, MetaFunction } from "@remix-run/node";
22
import {
33
Links,
44
LiveReload,
@@ -16,9 +16,7 @@ export const meta: MetaFunction = () => ({
1616
viewport: "width=device-width,initial-scale=1",
1717
});
1818

19-
export function links() {
20-
return [{ rel: "stylesheet", href: styles }];
21-
}
19+
export const links: LinksFunction = () => [{ rel: "stylesheet", href: styles }];
2220

2321
export default function App() {
2422
return (

combobox-resource-route/app/routes/index.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,16 @@ import {
66
ComboboxPopover,
77
} from "@reach/combobox";
88
import comboboxStyles from "@reach/combobox/styles.css";
9+
import type { LinksFunction } from "@remix-run/react";
910
import { Form, useFetcher, useSearchParams } from "@remix-run/react";
1011

1112
import type { Lang } from "~/models/langs";
1213

13-
export function links() {
14+
export const links: LinksFunction = () => [
1415
// Add them to the page when this route is active:
1516
// https://remix.run/route/links
16-
return [{ rel: "stylesheet", href: comboboxStyles }];
17-
}
17+
{ rel: "stylesheet", href: comboboxStyles },
18+
];
1819

1920
export default function Index() {
2021
// Set up a fetcher to fetch languages as the user types

infinite-scrolling/app/routes/offset/advanced.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ import { useVirtual } from "react-virtual";
1818
import stylesUrl from "~/styles/index.css";
1919
import { countItems, getItems } from "~/utils/backend.server";
2020

21-
export const links: LinksFunction = () => {
22-
return [{ rel: "stylesheet", href: stylesUrl }];
23-
};
21+
export const links: LinksFunction = () => [
22+
{ rel: "stylesheet", href: stylesUrl },
23+
];
2424

2525
const LIMIT = 200;
2626
const DATA_OVERSCAN = 40;

infinite-scrolling/app/routes/offset/simple.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ import { useVirtual } from "react-virtual";
77
import stylesUrl from "~/styles/index.css";
88
import { getItems } from "~/utils/backend.server";
99

10-
export const links: LinksFunction = () => {
11-
return [{ rel: "stylesheet", href: stylesUrl }];
12-
};
10+
export const links: LinksFunction = () => [
11+
{ rel: "stylesheet", href: stylesUrl },
12+
];
1313

1414
const LIMIT = 200;
1515
const DATA_OVERSCAN = 40;

infinite-scrolling/app/routes/page/advanced.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ import { useVirtual } from "react-virtual";
1818
import stylesUrl from "~/styles/index.css";
1919
import { countItems, getItemsPaginated } from "~/utils/backend.server";
2020

21-
export const links: LinksFunction = () => {
22-
return [{ rel: "stylesheet", href: stylesUrl }];
23-
};
21+
export const links: LinksFunction = () => [
22+
{ rel: "stylesheet", href: stylesUrl },
23+
];
2424

2525
const LIMIT = 200;
2626
const DATA_OVERSCAN = 40;

0 commit comments

Comments
 (0)