From a69a7346c9feece43a746afc97700d5c5215c37a Mon Sep 17 00:00:00 2001 From: Nico Lynzaad Date: Thu, 9 Oct 2025 22:49:17 +0200 Subject: [PATCH 1/3] add extra context --- docs/router/framework/react/guide/navigation.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/router/framework/react/guide/navigation.md b/docs/router/framework/react/guide/navigation.md index 308a8f8f9c..d6677c3a2a 100644 --- a/docs/router/framework/react/guide/navigation.md +++ b/docs/router/framework/react/guide/navigation.md @@ -185,6 +185,11 @@ By default, all links are absolute unless a `from` route path is provided. This Relative links can be combined with a `from` route path. If a from route path isn't provided, relative paths default to the current active location. +> [!NOTE] +> Keep in mind that when calling useNavigate as a method on the route, for example `Route.useNavigate`, then the `from` location is predefined to be the route its called on. +> +> Another common pitfall is when using this in a pathless layout route, since the pathless layout route does not have an actual path, the `from` location is regarded as the parent of the pathless layout route. Hence relative routing will be resolved from this parent. + ```tsx const postIdRoute = createRoute({ path: '/blog/post/$postId', From 5a3255d9f50dd0c945362e6193a1a8af206408ed Mon Sep 17 00:00:00 2001 From: "autofix-ci[bot]" <114827586+autofix-ci[bot]@users.noreply.github.com> Date: Thu, 9 Oct 2025 20:55:20 +0000 Subject: [PATCH 2/3] ci: apply automated fixes --- docs/router/framework/react/guide/navigation.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/router/framework/react/guide/navigation.md b/docs/router/framework/react/guide/navigation.md index d6677c3a2a..df64d20dec 100644 --- a/docs/router/framework/react/guide/navigation.md +++ b/docs/router/framework/react/guide/navigation.md @@ -187,7 +187,7 @@ Relative links can be combined with a `from` route path. If a from route path is > [!NOTE] > Keep in mind that when calling useNavigate as a method on the route, for example `Route.useNavigate`, then the `from` location is predefined to be the route its called on. -> +> > Another common pitfall is when using this in a pathless layout route, since the pathless layout route does not have an actual path, the `from` location is regarded as the parent of the pathless layout route. Hence relative routing will be resolved from this parent. ```tsx From 269b2d87bf2e590f2b20be23819bb976537747a4 Mon Sep 17 00:00:00 2001 From: Nico Lynzaad Date: Thu, 9 Oct 2025 23:03:56 +0200 Subject: [PATCH 3/3] add code rabbit suggestion --- docs/router/framework/react/guide/navigation.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/router/framework/react/guide/navigation.md b/docs/router/framework/react/guide/navigation.md index df64d20dec..42e0784d8a 100644 --- a/docs/router/framework/react/guide/navigation.md +++ b/docs/router/framework/react/guide/navigation.md @@ -186,7 +186,7 @@ By default, all links are absolute unless a `from` route path is provided. This Relative links can be combined with a `from` route path. If a from route path isn't provided, relative paths default to the current active location. > [!NOTE] -> Keep in mind that when calling useNavigate as a method on the route, for example `Route.useNavigate`, then the `from` location is predefined to be the route its called on. +> Keep in mind that when calling useNavigate as a method on the route, for example `Route.useNavigate`, then the `from` location is predefined to be the route it's called on. > > Another common pitfall is when using this in a pathless layout route, since the pathless layout route does not have an actual path, the `from` location is regarded as the parent of the pathless layout route. Hence relative routing will be resolved from this parent.