Skip to content

fix(react-router): only navigate once in StrictMode - #3465

Merged
schiller-manuel merged 1 commit into
mainfrom
fix-3455
Feb 18, 2025
Merged

fix(react-router): only navigate once in StrictMode#3465
schiller-manuel merged 1 commit into
mainfrom
fix-3455

Conversation

@schiller-manuel

Copy link
Copy Markdown
Collaborator

fixes #3455

@nx-cloud

nx-cloud Bot commented Feb 18, 2025

Copy link
Copy Markdown
Contributor

View your CI Pipeline Execution ↗ for commit fc3194d.

Command Status Duration Result
nx affected --targets=test:eslint,test:unit,tes... ✅ Succeeded 4m 9s View ↗
nx run-many --target=build --exclude=examples/*... ✅ Succeeded 1m 20s View ↗

☁️ Nx Cloud last updated this comment at 2025-02-18 01:08:57 UTC

@pkg-pr-new

pkg-pr-new Bot commented Feb 18, 2025

Copy link
Copy Markdown

Open in Stackblitz

More templates

@tanstack/arktype-adapter

npm i https://pkg.pr.new/@tanstack/arktype-adapter@3465

@tanstack/create-router

npm i https://pkg.pr.new/@tanstack/create-router@3465

@tanstack/create-start

npm i https://pkg.pr.new/@tanstack/create-start@3465

@tanstack/directive-functions-plugin

npm i https://pkg.pr.new/@tanstack/directive-functions-plugin@3465

@tanstack/eslint-plugin-router

npm i https://pkg.pr.new/@tanstack/eslint-plugin-router@3465

@tanstack/history

npm i https://pkg.pr.new/@tanstack/history@3465

@tanstack/react-cross-context

npm i https://pkg.pr.new/@tanstack/react-cross-context@3465

@tanstack/react-router

npm i https://pkg.pr.new/@tanstack/react-router@3465

@tanstack/router-cli

npm i https://pkg.pr.new/@tanstack/router-cli@3465

@tanstack/react-router-with-query

npm i https://pkg.pr.new/@tanstack/react-router-with-query@3465

@tanstack/router-core

npm i https://pkg.pr.new/@tanstack/router-core@3465

@tanstack/router-devtools

npm i https://pkg.pr.new/@tanstack/router-devtools@3465

@tanstack/router-generator

npm i https://pkg.pr.new/@tanstack/router-generator@3465

@tanstack/router-plugin

npm i https://pkg.pr.new/@tanstack/router-plugin@3465

@tanstack/router-utils

npm i https://pkg.pr.new/@tanstack/router-utils@3465

@tanstack/router-vite-plugin

npm i https://pkg.pr.new/@tanstack/router-vite-plugin@3465

@tanstack/server-functions-plugin

npm i https://pkg.pr.new/@tanstack/server-functions-plugin@3465

@tanstack/start

npm i https://pkg.pr.new/@tanstack/start@3465

@tanstack/start-api-routes

npm i https://pkg.pr.new/@tanstack/start-api-routes@3465

@tanstack/start-client

npm i https://pkg.pr.new/@tanstack/start-client@3465

@tanstack/start-config

npm i https://pkg.pr.new/@tanstack/start-config@3465

@tanstack/start-plugin

npm i https://pkg.pr.new/@tanstack/start-plugin@3465

@tanstack/start-router-manifest

npm i https://pkg.pr.new/@tanstack/start-router-manifest@3465

@tanstack/start-server

npm i https://pkg.pr.new/@tanstack/start-server@3465

@tanstack/start-server-functions-client

npm i https://pkg.pr.new/@tanstack/start-server-functions-client@3465

@tanstack/start-server-functions-fetcher

npm i https://pkg.pr.new/@tanstack/start-server-functions-fetcher@3465

@tanstack/start-server-functions-handler

npm i https://pkg.pr.new/@tanstack/start-server-functions-handler@3465

@tanstack/start-server-functions-server

npm i https://pkg.pr.new/@tanstack/start-server-functions-server@3465

@tanstack/start-server-functions-ssr

npm i https://pkg.pr.new/@tanstack/start-server-functions-ssr@3465

@tanstack/valibot-adapter

npm i https://pkg.pr.new/@tanstack/valibot-adapter@3465

@tanstack/virtual-file-routes

npm i https://pkg.pr.new/@tanstack/virtual-file-routes@3465

@tanstack/zod-adapter

npm i https://pkg.pr.new/@tanstack/zod-adapter@3465

commit: fc3194d

@schiller-manuel
schiller-manuel merged commit 0277309 into main Feb 18, 2025
@schiller-manuel
schiller-manuel deleted the fix-3455 branch February 18, 2025 01:10
kamalbennani pushed a commit to kamalbennani/router that referenced this pull request Aug 15, 2026
TanStack#3465 made Navigate navigate once under StrictMode by comparing the props
object by identity. That holds there only because React hands both passes of
the double-invoked effect the same props object, which is why it cannot hold
across a real re-render. Guarding on the resolved destination must keep TanStack#3465
working, so pin it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

<StrictMode/> breaks beforeLoad context injection on parent matches when using <Navigate/>

1 participant