Skip to content

refactor: hoist constants out of Router component#77

Merged
uhyo merged 1 commit intomasterfrom
refactor/router-hoist-constants
Feb 7, 2026
Merged

refactor: hoist constants out of Router component#77
uhyo merged 1 commit intomasterfrom
refactor/router-hoist-constants

Conversation

@uhyo
Copy link
Owner

@uhyo uhyo commented Feb 7, 2026

Summary

  • Move noopSubscribe and getServerSnapshot to module-level constants, removing unnecessary useCallback wrappers since they have no dependencies
  • Remove redundant setLocationEntry(adapter.getSnapshot()) call in useEffect, since useSyncExternalStore already handles SSR-to-hydration snapshot mismatches

Test plan

  • All 177 existing tests pass
  • No type errors

🤖 Generated with Claude Code

…t hydration sync

Move `noopSubscribe` and `getServerSnapshot` to module-level constants
since they have no dependencies, eliminating unnecessary `useCallback`
wrappers. Remove the redundant `setLocationEntry` call in useEffect
since `useSyncExternalStore` already handles SSR-to-hydration mismatches.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@uhyo uhyo merged commit 4a4ef2c into master Feb 7, 2026
1 check passed
@uhyo uhyo deleted the refactor/router-hoist-constants branch February 7, 2026 07:51
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