# Prevent the React Router Loader to Run after Document Request

Used: react-router@7.0.0

Let's say you're building a route that needs a loader, but you only want this loader to really run once on the document request, for a client-side navigation from another route you most likely already have the loader data for any reason and want to avoid React Router to fetch the loader

You can export a `clientLoader` function from your route to control when the server loader runs, which can be never.

```ts {% path="app/routes/something.ts" %}
export async function loader(args: LoaderFunctionArgs) {
  // some code that probably take a lot to run
}

export function clientLoader() {
  return null
}
```

With this simple `clientLoader` function, we can ensure that the server loader will run on a document request only.
