Skip to content

Commit

Permalink
chore: add preloading spriteUrl example
Browse files Browse the repository at this point in the history
Signed-off-by: Logan McAnsh <[email protected]>
  • Loading branch information
mcansh committed Apr 10, 2024
1 parent 05e6ac7 commit 09e1cbb
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion examples/remix/app/routes/_index/route.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { MetaFunction } from "@remix-run/node";
import type { LinksFunction, MetaFunction } from "@remix-run/node";
import archiveBoxArrowDownIconHref from "~/assets/archive-box-arrow-down.svg";
import beakerIconHref from "heroicons/24/outline/beaker.svg";
import eyeIconHref from "lucide-static/icons/eye.svg";
Expand All @@ -13,6 +13,17 @@ export const meta: MetaFunction = () => {
];
};

export const links: LinksFunction = () => {
return [
{
rel: "preload",
as: "image",
href: spriteUrl,
type: "image/svg+xml",
},
];
};

export default function Index() {
return (
<div style={{ fontFamily: "system-ui, sans-serif", lineHeight: "1.8" }}>
Expand Down

0 comments on commit 09e1cbb

Please sign in to comment.