Skip to content

Commit

Permalink
Another router fix
Browse files Browse the repository at this point in the history
  • Loading branch information
BenLorantfy committed Jul 14, 2024
1 parent 39c3e21 commit 622b744
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/docs-site/src/components/Router.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ export function Router({ children }: { children: React.ReactNode }) {
export function usePathname() {
useContext(CounterContext);
const pathname = window.location.pathname;
if (pathname === "/") {
return pathname;
}

if (pathname.endsWith("/")) {
return pathname.substring(0, pathname.length - 1);
}
Expand Down

0 comments on commit 622b744

Please sign in to comment.