--- url: "https://web.dev/articles/quicklink" titulek: "Speed up navigations in React with Quicklink | Articles | web.dev" h1: "Speed up navigations in React with Quicklink Stay organized with collections Save and categorize content based on your preferences." popis: "quicklink is a library to achieve faster subsequent page-loads by prefetching in-viewport links during idle time." jazyk: "en" kanonicka: "https://web.dev/articles/quicklink" drobecky: ["Articles", "Speed up navigations in React with Quicklink"] zdroj: "live" wayback_snapshot: "" stazeno: "2026-09-13 23:12:21" znaku: 6081 slov: 857 kodovani: "iso-8859-2" sha256: "bd4413d7f8ff9b90a7eb0e13f9399ed3ceb7a2b03951f36ec34e58a1cfda4f21" --- Speed up navigations in React with Quicklink Stay organized with collections Save and categorize content based on your preferences. Automatically prefetch in-viewport links with quicklink for React single page applications. Addy Osmani Anton Karlovskiy DemiĂĄn Renzulli [Prefetching](/articles/link-prefetch) is a technique to speed up navigations by downloading the resources for the next page, ahead of time. [Quicklink](https://github.com/GoogleChromeLabs/quicklink) is a library that allows you to implement this technique at scale, by automatically prefetching links as they come into the view. In multi-page apps the library prefetches documents (e.g. `/article.html`), for in-viewport links, so that when the user clicks on these links they can be picked up from the [HTTP cache](/articles/http-cache). [Single-page apps](https://en.wikipedia.org/wiki/Single-page_application) commonly use a technique called [route-based code splitting](/articles/reduce-javascript-payloads-with-code-splitting). This allows the site to load the code for a given route only when the user navigates to it. These files (JS, CSS) are commonly referred to as "chunks". With that said, in these sites, instead of prefetching documents the biggest performance gains come from prefetching these chunks before the page needs them. Achieving this presents some challenges: It's not trivial to determine which chunks (e.g. `article.chunk.js`) are associated with a given route (e.g. `/article`) before landing on it. The final URL names of these chunks can't be predicted, as modern module bundlers typically use long-term hashing for versioning (e.g. `article.chunk.46e51.js`). This guide explains how Quicklink solves these challenges and allows you to achieve prefetching at scale in React single page apps. Determine chunks associated with each route One of the core components of `quicklink` is [webpack-route-manifest](https://github.com/lukeed/webpack-route-manifest), a [webpack](https://webpack.js.org/) plugin that lets you generate a JSON dictionary of routes and chunks. This allows the library to know which files are going to be needed by each route of the application and prefetch them as the routes come into the view. After [integrating the plugin](https://github.com/lukeed/webpack-route-manifest#install) with the project, it will produce a JSON manifest file associating each route with its corresponding chunks: `{ '/about': [ { type: 'style', href: '/static/css/about.f6fd7d80.chunk.css', }, { type: 'script', href: '/static/js/about.1cdfef3b.chunk.js', }, ], '/blog': [ { type: 'style', href: '/static/css/blog.85e80e75.chunk.css', }, { type: 'script', href: '/static/js/blog.35421503.chunk.js', }, ], }` This manifest file can be requested in two ways: By URL, e.g. `https://site_url/rmanifest.json`. Through the window object, at `window.__rmanifest`. Prefetch chunks for in-viewport routes Once the manifest file is available, the next step is to install Quicklink by running `npm install quicklink`. Then, the [higher order component (HOC)](https://reactjs.org/docs/higher-order-components.html) `withQuicklink()` can be used to indicate that a given route should be prefetched when the link comes into the view. The following code belongs to an `App` component of a React app that renders a top menu with four links: `const App = () => (