Automatic in your routes config
Works out of the box in routes.ts, routes.js, routes.tsx and routes.jsx. No config file, no import to add.
VS Code Marketplace · v0.1.0 · MIT
React Router Route Links turns the route file paths and API route strings
in your routes.ts config into real, clickable links.
Ctrl+Click any of them to jump straight to the file that
handles it — no manual searching, no breaking your flow.
import { type RouteConfig, index, route } from "@react-router/dev/routes"; export default [ index("routes/home.tsx"), route("about", "routes/about.tsx"), route("api/users/:id", "routes/api/user.tsx"),] satisfies RouteConfig;// literal route strings anywhere become linksconst PROFILE = "/api/users/123";const ABOUT = "/about"; export async function load() { return fetch(PROFILE).then(r => r.json());}
The problem
VS Code's TypeScript server only supports go-to-definition on real
import statements. But in a React Router v7 config, route
modules are referenced as plain strings — and plain strings are
inert to the editor.
import { type RouteConfig, index, route } from "@react-router/dev/routes"; export default [ index("routes/home.tsx"), route("about", "routes/about.tsx"),] satisfies RouteConfig;No underline, no Ctrl+Click. You hunt through folders to find out what routes/home.tsx even renders.
import { type RouteConfig, index, route } from "@react-router/dev/routes"; export default [ index("routes/home.tsx"), route("about", "routes/about.tsx"),] satisfies RouteConfig;Hover to underline, Ctrl+Click to open the module instantly.
Features
Everything it does, and nothing it doesn't.
Works out of the box in routes.ts, routes.js, routes.tsx and routes.jsx. No config file, no import to add.
In any .ts, .js, .tsx or .jsx file, a string like "/api/users/:id" becomes clickable and jumps to the module that serves it.
Follows nested route(), index(), layout() and prefix() calls to work out the full path of every route.
Targets are checked against the filesystem. A typo'd path simply won't underline — doubling as a lightweight sanity check on your config.
Resolves relative to the routes file's own directory, with fallbacks to the workspace root, app/, src/app/ and src/.
Zero runtime dependencies, no bundler, no background watchers. Route maps are parsed once and cached against the config file's mtime.
How it works
Both are plain VS Code document links — hover to underline, Ctrl+Click (Cmd+Click on macOS) to open.
Link type 1
A string literal that ends in a route file extension — like "routes/home.tsx" — becomes a link to that module. Resolution is relative to the routes file's own directory, with sensible fallbacks.
index("routes/home.tsx"), route("about", "routes/about.tsx"),Link type 2
Any string that looks like a URL path is matched against the routes parsed from your config. If it corresponds to a real route, it links straight to the module that handles it — dynamic segments included.
const PROFILE = "/api/users/123";const ABOUT = "/about";Route helpers it understands
route()
index()
layout()
prefix()
nested calls
dynamic segments :id
splat routes *
Settings
Edit under Settings → Extensions → React Router Route Links,
or drop the JSON straight into settings.json.
| Setting | Default | Description |
|---|---|---|
reactRouterRouteLinks.fileNames |
routes.ts, routes.js, routes.tsx, routes.jsx |
Which files get link treatment. |
reactRouterRouteLinks.extensions |
.tsx, .ts, .jsx, .js, .mdx, .md |
String suffixes treated as route file paths. |
{
"reactRouterRouteLinks.fileNames": ["routes.ts", "routes.js"],
"reactRouterRouteLinks.extensions": [".tsx", ".ts", ".jsx", ".js"]
}
Install
Search "React Router Route Links" in the VS Code Extensions panel, or click below.
Open in MarketplaceInstall it with a single command.
code --install-extension anparasan.routelinks
Requires VS Code 1.85.0 or newer. Once installed, open your
routes.ts and Ctrl+Click any route string.
FAQ
Yes. Remix uses the same routes.ts config format, so the extension works there too.
No. Paths are resolved relative to the routes file's own directory first, then the workspace root, app/, src/app/ and src/. If the routes config lives somewhere unusual, the extension also searches the workspace for it.
Nothing is linked. Only strings that resolve to a real file on disk become links, so typos simply don't underline.
No. There are no runtime dependencies and no file watchers. Your routes config is parsed once and the result is cached until the file changes on disk.
Dynamic template literals like `/users/${id}` are skipped, since their value isn't known statically. Static strings are linked as usual.
Yes — MIT licensed. The full source is on GitHub, and contributions are welcome.
One install and every route in your React Router project becomes a link.