Skip to content
Source
Sign inSign up
TanStack/router

fix: navigate() respects rewrites when reloadDocument=true #5389

Mergedschiller-manuel(GitHub profile, opens in a new tab)merged 2 commits intomain fromrefs/pull/5389/headmerged by schiller-manuel(GitHub profile, opens in a new tab)

Showing 16 changed files with 48 additions and 0 deletions (loading 11).

x
0 of 16 viewed, 16 left
3 additions and 0 deletionse2e/react-router/basepath-file-based/src/routes/__root.tsxAdded
View file
@@ -0,0 +1,3 @@
+import { createRootRoute } from '@tanstack/react-router'
+​
+export const Route = createRootRoute()
20 additions and 0 deletionse2e/react-router/basepath-file-based/src/routes/about.tsxAdded
View file
@@ -0,0 +1,20 @@
+import { createFileRoute } from '@tanstack/react-router'
+​
+export const Route = createFileRoute('/about')({
+ component: RouteComponent,
+})
+​
+function RouteComponent() {
+ const navigate = Route.useNavigate()
+​
+ return (
+ <div data-testid="about-component">
+ <button
+ onClick={() => navigate({ to: '/', reloadDocument: true })}
+ data-testid="to-home-btn"
+ >
+ Navigate to / with document reload
+ </button>
+ </div>
+ )