Skip to content

feat: add useLocationSSR hook and make docs Layout an SSR app shell#74

Merged
uhyo merged 1 commit intomasterfrom
feat/use-location-ssr-app-shell
Feb 7, 2026
Merged

feat: add useLocationSSR hook and make docs Layout an SSR app shell#74
uhyo merged 1 commit intomasterfrom
feat/use-location-ssr-app-shell

Conversation

@uhyo
Copy link
Owner

@uhyo uhyo commented Feb 7, 2026

Summary

  • Add useLocationSSR() hook to @funstack/router that returns Location | null (returns null during SSR instead of throwing)
  • Make the docs site Layout component a pathless route so it renders as an app shell during SSR
  • Update Layout to use useLocationSSR() for active nav highlighting, gracefully handling the SSR case
  • Add documentation for useLocationSSR() to API hooks page, API reference index, and SSR learn page

Test plan

  • pnpm --filter @funstack/router build — router builds with new export
  • pnpm typecheck — no type errors across all packages
  • pnpm --filter @funstack/router test:run — all 177 tests pass including 3 new useLocationSSR tests
  • pnpm format — formatting is correct

🤖 Generated with Claude Code

Add `useLocationSSR()` hook that returns `Location | null` instead of
throwing when URL is unavailable during SSR. Use it in the docs site
Layout component, which is now a pathless route so it renders as an
app shell during SSR.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@uhyo uhyo merged commit b930e48 into master Feb 7, 2026
1 check passed
@uhyo uhyo deleted the feat/use-location-ssr-app-shell branch February 7, 2026 03:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant