{
  "id": "6a57d7d0644ea57e8f94eca7",
  "source": "solid:signals",
  "type": "github-document",
  "title": "use-resolved-path",
  "content": "---\ntitle: useResolvedPath\nuse_cases: \u003e-\n  modular routing, nested routers, relative paths, dynamic base paths, component\n  isolation\ntags:\n  - path\n  - modular\n  - nested\n  - routing\n  - base\n  - resolved\nversion: '1.0'\ndescription: \u003e-\n  Resolve relative paths with useResolvedPath - build modular routers, handle\n  nested routes, and create isolated routing components.\n---\n\n`useResolvedPath` retrieves a signal\\\u003cstring\\\u003e.\nIt contains the current resolved path as defined in the Route.\n\n```js\nconst path = useResolvedPath(() =\u003e '');\n\n// Parent Route path: /user/*\nconsole.log(path()); // /user\n\nconst path = useResolvedPath(() =\u003e 'a/b/c');\n\n// Parent Route path: /user/*\nconsole.log(path()); // /user/a/b/c\n\nconst path = useResolvedPath(() =\u003e '/a/b/c'); // Note: /\n\n// Parent Route path: /user/*\nconsole.log(path()); // a/b/c\n```\n\nUseful for making modular routers\n\n```js\nconst parentRoutePath = useResolvedPath(() =\u003e '');\n\nreturn \u003c\u003e\n        \u003ch1\u003eModule component layer\u003c/h1\u003e\n        \u003cRouter base={parentRoutePath()}\u003e // Modular magic\n            \u003cRoute path=\"/\" component={() =\u003e \u003cdiv\u003eIndex\u003c/div\u003e}/\u003e\n            \u003cRoute path=\"/a\" component={() =\u003e \u003cdiv\u003eAComponent\u003c/div\u003e}/\u003e\n        \u003c/Router\u003e\n\u003c/\u003e\n```",
  "url": "https://github.com/solidjs/solid-docs/blob/HEAD/src/routes/solid-router/reference/primitives/use-resolved-path.mdx",
  "metadata": {
    "path": "src/routes/solid-router/reference/primitives/use-resolved-path.mdx",
    "repo": "solidjs/solid-docs",
    "repo_url": "https://github.com/solidjs/solid-docs.git",
    "size": 1200,
    "source_type": "github"
  },
  "hash": "b20642b5088af0dc751947e62837440afb1cf7ae65781de934cc611c7bb5ff04",
  "timestamp": "2026-02-23T11:43:00.193236516+01:00"
}