mirror of
https://github.com/TanStack/router.git
synced 2026-11-16 19:38:07 +00:00
This is a follow-up to #4978. As picked up by @Sheraff the changes made caused useNavigate to negatively impact performance specifically with useNavigate being too reactive to path changes. This reverts the use of useActiveLocation, that acted as a single implementation of the logic to determine the from location, and moves the determination of the from path back to each of Link and useNavigate. While the core logic is still the same across the implementations the implication of how it's used and the sources of the required inputs are different enough that it warrants separate implementations. This PR does not revert the full change set and still applies to core reasons and changes for the previous commit in keeping the logic for determining the from clause the same, i.e. the order of determining the from path for navigation remains: from clause => current location => rendered location. @Sheraff to advise if this implementation resolves the issues he picked up. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * Breaking Changes * Removed active-location hooks and their associated types from React and Solid packages. * Refactor * Link and navigation now accept an explicit "from" option instead of deriving it from active-location state. * New Features * Added a programmatic Navigate helper for Solid to trigger navigation on mount. * Bug Fixes * More predictable fallback behavior when no explicit "from" is provided. * Performance * Reduced state subscriptions for minor efficiency gains. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> |
History
|
|
|---|---|---|
| .. | ||
| src | ||
| tests | ||
| .gitignore | ||
| index.html | ||
| package.json | ||
| playwright.config.ts | ||
| postcss.config.mjs | ||
| tailwind.config.mjs | ||
| tsconfig.json | ||
| vite.config.js | ||