Skip to content

fix!: remove useLocationSSR hook#79

Merged
uhyo merged 1 commit intomasterfrom
remove-useLocationSSR
Feb 7, 2026
Merged

fix!: remove useLocationSSR hook#79
uhyo merged 1 commit intomasterfrom
remove-useLocationSSR

Conversation

@uhyo
Copy link
Owner

@uhyo uhyo commented Feb 7, 2026

Summary

  • Removed useLocationSSR hook from @funstack/router — it was a footgun that easily caused hydration mismatches (router context state vs actual DOM divergence during hydration)
  • Updated SSR docs to recommend a client-side effect approach (useLayoutEffect + Navigation API) instead
  • Cleaned up API reference index, hooks page, and test suite

BREAKING CHANGE

useLocationSSR is no longer exported from @funstack/router. Use a custom hook with useLayoutEffect + navigation.currentEntry to safely access the current path in SSR-rendered components.

Test plan

  • pnpm build — all packages build successfully
  • pnpm typecheck — no type errors
  • pnpm test:run — 174 tests pass
  • pnpm format — all files formatted correctly
  • No remaining references to useLocationSSR in the codebase

🤖 Generated with Claude Code

useLocationSSR was a footgun that easily caused hydration mismatches
because the router context state and the actual DOM could diverge
during hydration. The docs now recommend using a client-side effect
approach (useLayoutEffect + Navigation API) instead.

BREAKING CHANGE: useLocationSSR hook has been removed from the public API.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@uhyo uhyo merged commit 1347035 into master Feb 7, 2026
1 check passed
@uhyo uhyo deleted the remove-useLocationSSR branch February 7, 2026 11:35
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