{"id":25833848,"url":"https://github.com/joulev/get-pathname-in-server-components","last_synced_at":"2026-05-13T17:43:02.644Z","repository":{"id":264896844,"uuid":"806050222","full_name":"joulev/get-pathname-in-server-components","owner":"joulev","description":"A small Next.js App Router app where the navbar, with active state, is rendered entirely in server components. No, don't ask me why this works","archived":false,"fork":false,"pushed_at":"2024-05-26T08:52:26.000Z","size":22,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-24T21:43:10.934Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://get-pathname-in-server-components.vercel.app","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/joulev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-05-26T08:28:56.000Z","updated_at":"2024-05-27T03:56:38.000Z","dependencies_parsed_at":"2024-11-26T18:03:00.488Z","dependency_job_id":null,"html_url":"https://github.com/joulev/get-pathname-in-server-components","commit_stats":null,"previous_names":["joulev/get-pathname-in-server-components"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joulev%2Fget-pathname-in-server-components","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joulev%2Fget-pathname-in-server-components/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joulev%2Fget-pathname-in-server-components/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joulev%2Fget-pathname-in-server-components/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/joulev","download_url":"https://codeload.github.com/joulev/get-pathname-in-server-components/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241275902,"owners_count":19937420,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-02-28T23:32:32.949Z","updated_at":"2026-05-13T17:43:02.613Z","avatar_url":"https://github.com/joulev.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"A small Next.js App Router app where the navbar, with active state, is rendered entirely on the server.\n\nCredit to [this Next.js PR](https://github.com/vercel/next.js/pull/65922).\n\n### What are the drawbacks?\n\nFirstly, this only works in prod mode. Secondly, it requires completely disabling the router cache.\n\nAnd there could be many edge cases. I don't know, I am not knowledgeable enough on the internal Next.js logic to make any statements regarding this issue.\n\n### Should I use this to make my navbar?\n\nOh god no. Just\n\n```jsx\n\"use client\";\n\nexport function NavbarItem({ href, children }) {\n  const pathname = usePathname()\n  const isActive = pathname === href;\n  return ...;\n}\n```\n\n```jsx\nfunction Navbar() {\n  return items.map((item) =\u003e (\n    \u003cNavbarItem href={item.href} key={item.href}\u003e\n      {item.name}\n    \u003c/NavbarItem\u003e\n  ));\n}\n```\n\nYou don't want to use internal undocumented APIs just for something as simple as this.\n\n![](https://www.obilityb2b.com/wp-content/uploads/2020/07/Jeff-Goldblum-GIF.gif)\n\n### How is this even possible?\n\nSame question, man. Same question.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoulev%2Fget-pathname-in-server-components","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjoulev%2Fget-pathname-in-server-components","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoulev%2Fget-pathname-in-server-components/lists"}