-
In a Remix SPA Mode app, let's say I have this route : routes/cats.tsx export async function clientLoader() {
const data = await fetch("https://meowfacts.herokuapp.com/")
.then((res) => res.json());
return json(data);
}
export default function CatPage() {
const catFacts = useLoaderData();
return (
<div className="font-sans p-4">
<h1 className="text-3xl">Cat facts</h1>
<p>{catFacts.data[0]}</p>
</div>
);
} And somewhere I have a <Link to="/cats" prefetch="intent">
Cat facts
</Link> Is there a way to configure Remix so that, when prefetching the cats.tsx route, it already executes the If this is not possible, what is the real |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
It's not possible, at least right now, to prefetch a clientLoader.
It will still prefetch the code for the next route, without that the user will need to wait for the next route code to download so it can call the client loaders. |
Beta Was this translation helpful? Give feedback.
It's not possible, at least right now, to prefetch a clientLoader.
It will still prefetch the code for the next route, without that the user will need to wait for the next route code to download so it can call the client loaders.