From bb84e15d9f3e027be0d9cee7340a43344ddbff18 Mon Sep 17 00:00:00 2001 From: Ulrich Stark <8657779+ulrichstark@users.noreply.github.com> Date: Thu, 4 Jun 2026 21:13:55 +0200 Subject: [PATCH] fix(examples): make isRoot check work --- .../basic-auth/src/components/DefaultCatchBoundary.tsx | 8 +++----- .../src/components/DefaultCatchBoundary.tsx | 8 +++----- .../src/components/DefaultCatchBoundary.tsx | 8 +++----- .../basic/src/components/DefaultCatchBoundary.tsx | 8 +++----- .../clerk-basic/src/components/DefaultCatchBoundary.tsx | 8 +++----- .../src/components/DefaultCatchBoundary.tsx | 8 +++----- .../src/components/DefaultCatchBoundary.tsx | 8 +++----- .../src/components/DefaultCatchBoundary.tsx | 8 +++----- .../src/components/DefaultCatchBoundary.tsx | 8 +++----- .../website/src/components/DefaultCatchBoundary.tsx | 8 +++----- .../basic-auth/src/components/DefaultCatchBoundary.tsx | 8 +++----- .../src/components/DefaultCatchBoundary.tsx | 8 +++----- .../basic/src/components/DefaultCatchBoundary.tsx | 8 +++----- .../src/components/DefaultCatchBoundary.tsx | 8 +++----- .../src/components/DefaultCatchBoundary.tsx | 8 +++----- .../src/components/DefaultCatchBoundary.tsx | 8 +++----- .../src/components/DefaultCatchBoundary.tsx | 8 +++----- .../website/src/components/DefaultCatchBoundary.tsx | 8 +++----- .../basic-auth/src/components/DefaultCatchBoundary.tsx | 8 +++----- .../src/components/DefaultCatchBoundary.tsx | 8 +++----- .../basic/src/components/DefaultCatchBoundary.tsx | 9 +++------ .../src/components/DefaultCatchBoundary.tsx | 8 +++----- .../src/components/DefaultCatchBoundary.tsx | 8 +++----- .../src/components/DefaultCatchBoundary.tsx | 8 +++----- .../src/components/DefaultCatchBoundary.tsx | 8 +++----- .../website/src/components/DefaultCatchBoundary.tsx | 8 +++----- .../src/components/DefaultCatchBoundary.tsx | 8 +++----- .../src/components/DefaultCatchBoundary.tsx | 8 +++----- .../src/components/DefaultCatchBoundary.tsx | 8 +++----- .../src/components/DefaultCatchBoundary.tsx | 8 +++----- .../src/components/DefaultCatchBoundary.tsx | 8 +++----- .../start-basic/src/components/DefaultCatchBoundary.tsx | 8 +++----- .../src/components/DefaultCatchBoundary.tsx | 8 +++----- .../src/components/DefaultCatchBoundary.tsx | 8 +++----- .../src/components/DefaultCatchBoundary.tsx | 9 +++------ .../src/components/DefaultCatchBoundary.tsx | 8 +++----- .../src/components/DefaultCatchBoundary.tsx | 8 +++----- .../src/components/DefaultCatchBoundary.tsx | 8 +++----- .../src/components/DefaultCatchBoundary.tsx | 8 +++----- .../src/components/DefaultCatchBoundary.tsx | 8 +++----- .../src/components/DefaultCatchBoundary.tsx | 8 +++----- .../src/components/DefaultCatchBoundary.tsx | 8 +++----- .../src/components/DefaultCatchBoundary.tsx | 8 +++----- .../start-basic/src/components/DefaultCatchBoundary.tsx | 8 +++----- .../src/components/DefaultCatchBoundary.tsx | 8 +++----- 45 files changed, 135 insertions(+), 227 deletions(-) diff --git a/e2e/react-start/basic-auth/src/components/DefaultCatchBoundary.tsx b/e2e/react-start/basic-auth/src/components/DefaultCatchBoundary.tsx index ef2daa1ea1..405fb5f4a7 100644 --- a/e2e/react-start/basic-auth/src/components/DefaultCatchBoundary.tsx +++ b/e2e/react-start/basic-auth/src/components/DefaultCatchBoundary.tsx @@ -1,17 +1,15 @@ import { ErrorComponent, Link, - rootRouteId, - useMatch, + useLocation, useRouter, } from '@tanstack/react-router' import type { ErrorComponentProps } from '@tanstack/react-router' export function DefaultCatchBoundary({ error }: ErrorComponentProps) { const router = useRouter() - const isRoot = useMatch({ - strict: false, - select: (state) => state.id === rootRouteId, + const isRoot = useLocation({ + select: (location) => location.pathname === '/', }) console.error(error) diff --git a/e2e/react-start/basic-cloudflare/src/components/DefaultCatchBoundary.tsx b/e2e/react-start/basic-cloudflare/src/components/DefaultCatchBoundary.tsx index ef2daa1ea1..405fb5f4a7 100644 --- a/e2e/react-start/basic-cloudflare/src/components/DefaultCatchBoundary.tsx +++ b/e2e/react-start/basic-cloudflare/src/components/DefaultCatchBoundary.tsx @@ -1,17 +1,15 @@ import { ErrorComponent, Link, - rootRouteId, - useMatch, + useLocation, useRouter, } from '@tanstack/react-router' import type { ErrorComponentProps } from '@tanstack/react-router' export function DefaultCatchBoundary({ error }: ErrorComponentProps) { const router = useRouter() - const isRoot = useMatch({ - strict: false, - select: (state) => state.id === rootRouteId, + const isRoot = useLocation({ + select: (location) => location.pathname === '/', }) console.error(error) diff --git a/e2e/react-start/basic-react-query/src/components/DefaultCatchBoundary.tsx b/e2e/react-start/basic-react-query/src/components/DefaultCatchBoundary.tsx index ef2daa1ea1..405fb5f4a7 100644 --- a/e2e/react-start/basic-react-query/src/components/DefaultCatchBoundary.tsx +++ b/e2e/react-start/basic-react-query/src/components/DefaultCatchBoundary.tsx @@ -1,17 +1,15 @@ import { ErrorComponent, Link, - rootRouteId, - useMatch, + useLocation, useRouter, } from '@tanstack/react-router' import type { ErrorComponentProps } from '@tanstack/react-router' export function DefaultCatchBoundary({ error }: ErrorComponentProps) { const router = useRouter() - const isRoot = useMatch({ - strict: false, - select: (state) => state.id === rootRouteId, + const isRoot = useLocation({ + select: (location) => location.pathname === '/', }) console.error(error) diff --git a/e2e/react-start/basic/src/components/DefaultCatchBoundary.tsx b/e2e/react-start/basic/src/components/DefaultCatchBoundary.tsx index ef2daa1ea1..405fb5f4a7 100644 --- a/e2e/react-start/basic/src/components/DefaultCatchBoundary.tsx +++ b/e2e/react-start/basic/src/components/DefaultCatchBoundary.tsx @@ -1,17 +1,15 @@ import { ErrorComponent, Link, - rootRouteId, - useMatch, + useLocation, useRouter, } from '@tanstack/react-router' import type { ErrorComponentProps } from '@tanstack/react-router' export function DefaultCatchBoundary({ error }: ErrorComponentProps) { const router = useRouter() - const isRoot = useMatch({ - strict: false, - select: (state) => state.id === rootRouteId, + const isRoot = useLocation({ + select: (location) => location.pathname === '/', }) console.error(error) diff --git a/e2e/react-start/clerk-basic/src/components/DefaultCatchBoundary.tsx b/e2e/react-start/clerk-basic/src/components/DefaultCatchBoundary.tsx index ef2daa1ea1..405fb5f4a7 100644 --- a/e2e/react-start/clerk-basic/src/components/DefaultCatchBoundary.tsx +++ b/e2e/react-start/clerk-basic/src/components/DefaultCatchBoundary.tsx @@ -1,17 +1,15 @@ import { ErrorComponent, Link, - rootRouteId, - useMatch, + useLocation, useRouter, } from '@tanstack/react-router' import type { ErrorComponentProps } from '@tanstack/react-router' export function DefaultCatchBoundary({ error }: ErrorComponentProps) { const router = useRouter() - const isRoot = useMatch({ - strict: false, - select: (state) => state.id === rootRouteId, + const isRoot = useLocation({ + select: (location) => location.pathname === '/', }) console.error(error) diff --git a/e2e/react-start/custom-basepath/src/components/DefaultCatchBoundary.tsx b/e2e/react-start/custom-basepath/src/components/DefaultCatchBoundary.tsx index ef2daa1ea1..405fb5f4a7 100644 --- a/e2e/react-start/custom-basepath/src/components/DefaultCatchBoundary.tsx +++ b/e2e/react-start/custom-basepath/src/components/DefaultCatchBoundary.tsx @@ -1,17 +1,15 @@ import { ErrorComponent, Link, - rootRouteId, - useMatch, + useLocation, useRouter, } from '@tanstack/react-router' import type { ErrorComponentProps } from '@tanstack/react-router' export function DefaultCatchBoundary({ error }: ErrorComponentProps) { const router = useRouter() - const isRoot = useMatch({ - strict: false, - select: (state) => state.id === rootRouteId, + const isRoot = useLocation({ + select: (location) => location.pathname === '/', }) console.error(error) diff --git a/e2e/react-start/scroll-restoration/src/components/DefaultCatchBoundary.tsx b/e2e/react-start/scroll-restoration/src/components/DefaultCatchBoundary.tsx index ef2daa1ea1..405fb5f4a7 100644 --- a/e2e/react-start/scroll-restoration/src/components/DefaultCatchBoundary.tsx +++ b/e2e/react-start/scroll-restoration/src/components/DefaultCatchBoundary.tsx @@ -1,17 +1,15 @@ import { ErrorComponent, Link, - rootRouteId, - useMatch, + useLocation, useRouter, } from '@tanstack/react-router' import type { ErrorComponentProps } from '@tanstack/react-router' export function DefaultCatchBoundary({ error }: ErrorComponentProps) { const router = useRouter() - const isRoot = useMatch({ - strict: false, - select: (state) => state.id === rootRouteId, + const isRoot = useLocation({ + select: (location) => location.pathname === '/', }) console.error(error) diff --git a/e2e/react-start/server-functions/src/components/DefaultCatchBoundary.tsx b/e2e/react-start/server-functions/src/components/DefaultCatchBoundary.tsx index ef2daa1ea1..405fb5f4a7 100644 --- a/e2e/react-start/server-functions/src/components/DefaultCatchBoundary.tsx +++ b/e2e/react-start/server-functions/src/components/DefaultCatchBoundary.tsx @@ -1,17 +1,15 @@ import { ErrorComponent, Link, - rootRouteId, - useMatch, + useLocation, useRouter, } from '@tanstack/react-router' import type { ErrorComponentProps } from '@tanstack/react-router' export function DefaultCatchBoundary({ error }: ErrorComponentProps) { const router = useRouter() - const isRoot = useMatch({ - strict: false, - select: (state) => state.id === rootRouteId, + const isRoot = useLocation({ + select: (location) => location.pathname === '/', }) console.error(error) diff --git a/e2e/react-start/server-routes/src/components/DefaultCatchBoundary.tsx b/e2e/react-start/server-routes/src/components/DefaultCatchBoundary.tsx index ef2daa1ea1..405fb5f4a7 100644 --- a/e2e/react-start/server-routes/src/components/DefaultCatchBoundary.tsx +++ b/e2e/react-start/server-routes/src/components/DefaultCatchBoundary.tsx @@ -1,17 +1,15 @@ import { ErrorComponent, Link, - rootRouteId, - useMatch, + useLocation, useRouter, } from '@tanstack/react-router' import type { ErrorComponentProps } from '@tanstack/react-router' export function DefaultCatchBoundary({ error }: ErrorComponentProps) { const router = useRouter() - const isRoot = useMatch({ - strict: false, - select: (state) => state.id === rootRouteId, + const isRoot = useLocation({ + select: (location) => location.pathname === '/', }) console.error(error) diff --git a/e2e/react-start/website/src/components/DefaultCatchBoundary.tsx b/e2e/react-start/website/src/components/DefaultCatchBoundary.tsx index ef2daa1ea1..405fb5f4a7 100644 --- a/e2e/react-start/website/src/components/DefaultCatchBoundary.tsx +++ b/e2e/react-start/website/src/components/DefaultCatchBoundary.tsx @@ -1,17 +1,15 @@ import { ErrorComponent, Link, - rootRouteId, - useMatch, + useLocation, useRouter, } from '@tanstack/react-router' import type { ErrorComponentProps } from '@tanstack/react-router' export function DefaultCatchBoundary({ error }: ErrorComponentProps) { const router = useRouter() - const isRoot = useMatch({ - strict: false, - select: (state) => state.id === rootRouteId, + const isRoot = useLocation({ + select: (location) => location.pathname === '/', }) console.error(error) diff --git a/e2e/solid-start/basic-auth/src/components/DefaultCatchBoundary.tsx b/e2e/solid-start/basic-auth/src/components/DefaultCatchBoundary.tsx index 2c0d464a06..f44db955a0 100644 --- a/e2e/solid-start/basic-auth/src/components/DefaultCatchBoundary.tsx +++ b/e2e/solid-start/basic-auth/src/components/DefaultCatchBoundary.tsx @@ -1,17 +1,15 @@ import { ErrorComponent, Link, - rootRouteId, - useMatch, + useLocation, useRouter, } from '@tanstack/solid-router' import type { ErrorComponentProps } from '@tanstack/solid-router' export function DefaultCatchBoundary({ error }: ErrorComponentProps) { const router = useRouter() - const isRoot = useMatch({ - strict: false, - select: (state) => state.id === rootRouteId, + const isRoot = useLocation({ + select: (location) => location.pathname === '/', }) console.error(error) diff --git a/e2e/solid-start/basic-cloudflare/src/components/DefaultCatchBoundary.tsx b/e2e/solid-start/basic-cloudflare/src/components/DefaultCatchBoundary.tsx index 2c0d464a06..f44db955a0 100644 --- a/e2e/solid-start/basic-cloudflare/src/components/DefaultCatchBoundary.tsx +++ b/e2e/solid-start/basic-cloudflare/src/components/DefaultCatchBoundary.tsx @@ -1,17 +1,15 @@ import { ErrorComponent, Link, - rootRouteId, - useMatch, + useLocation, useRouter, } from '@tanstack/solid-router' import type { ErrorComponentProps } from '@tanstack/solid-router' export function DefaultCatchBoundary({ error }: ErrorComponentProps) { const router = useRouter() - const isRoot = useMatch({ - strict: false, - select: (state) => state.id === rootRouteId, + const isRoot = useLocation({ + select: (location) => location.pathname === '/', }) console.error(error) diff --git a/e2e/solid-start/basic/src/components/DefaultCatchBoundary.tsx b/e2e/solid-start/basic/src/components/DefaultCatchBoundary.tsx index 2c0d464a06..f44db955a0 100644 --- a/e2e/solid-start/basic/src/components/DefaultCatchBoundary.tsx +++ b/e2e/solid-start/basic/src/components/DefaultCatchBoundary.tsx @@ -1,17 +1,15 @@ import { ErrorComponent, Link, - rootRouteId, - useMatch, + useLocation, useRouter, } from '@tanstack/solid-router' import type { ErrorComponentProps } from '@tanstack/solid-router' export function DefaultCatchBoundary({ error }: ErrorComponentProps) { const router = useRouter() - const isRoot = useMatch({ - strict: false, - select: (state) => state.id === rootRouteId, + const isRoot = useLocation({ + select: (location) => location.pathname === '/', }) console.error(error) diff --git a/e2e/solid-start/custom-basepath/src/components/DefaultCatchBoundary.tsx b/e2e/solid-start/custom-basepath/src/components/DefaultCatchBoundary.tsx index 2c0d464a06..f44db955a0 100644 --- a/e2e/solid-start/custom-basepath/src/components/DefaultCatchBoundary.tsx +++ b/e2e/solid-start/custom-basepath/src/components/DefaultCatchBoundary.tsx @@ -1,17 +1,15 @@ import { ErrorComponent, Link, - rootRouteId, - useMatch, + useLocation, useRouter, } from '@tanstack/solid-router' import type { ErrorComponentProps } from '@tanstack/solid-router' export function DefaultCatchBoundary({ error }: ErrorComponentProps) { const router = useRouter() - const isRoot = useMatch({ - strict: false, - select: (state) => state.id === rootRouteId, + const isRoot = useLocation({ + select: (location) => location.pathname === '/', }) console.error(error) diff --git a/e2e/solid-start/scroll-restoration/src/components/DefaultCatchBoundary.tsx b/e2e/solid-start/scroll-restoration/src/components/DefaultCatchBoundary.tsx index 2c0d464a06..f44db955a0 100644 --- a/e2e/solid-start/scroll-restoration/src/components/DefaultCatchBoundary.tsx +++ b/e2e/solid-start/scroll-restoration/src/components/DefaultCatchBoundary.tsx @@ -1,17 +1,15 @@ import { ErrorComponent, Link, - rootRouteId, - useMatch, + useLocation, useRouter, } from '@tanstack/solid-router' import type { ErrorComponentProps } from '@tanstack/solid-router' export function DefaultCatchBoundary({ error }: ErrorComponentProps) { const router = useRouter() - const isRoot = useMatch({ - strict: false, - select: (state) => state.id === rootRouteId, + const isRoot = useLocation({ + select: (location) => location.pathname === '/', }) console.error(error) diff --git a/e2e/solid-start/server-functions/src/components/DefaultCatchBoundary.tsx b/e2e/solid-start/server-functions/src/components/DefaultCatchBoundary.tsx index 2c0d464a06..f44db955a0 100644 --- a/e2e/solid-start/server-functions/src/components/DefaultCatchBoundary.tsx +++ b/e2e/solid-start/server-functions/src/components/DefaultCatchBoundary.tsx @@ -1,17 +1,15 @@ import { ErrorComponent, Link, - rootRouteId, - useMatch, + useLocation, useRouter, } from '@tanstack/solid-router' import type { ErrorComponentProps } from '@tanstack/solid-router' export function DefaultCatchBoundary({ error }: ErrorComponentProps) { const router = useRouter() - const isRoot = useMatch({ - strict: false, - select: (state) => state.id === rootRouteId, + const isRoot = useLocation({ + select: (location) => location.pathname === '/', }) console.error(error) diff --git a/e2e/solid-start/server-routes/src/components/DefaultCatchBoundary.tsx b/e2e/solid-start/server-routes/src/components/DefaultCatchBoundary.tsx index 2c0d464a06..f44db955a0 100644 --- a/e2e/solid-start/server-routes/src/components/DefaultCatchBoundary.tsx +++ b/e2e/solid-start/server-routes/src/components/DefaultCatchBoundary.tsx @@ -1,17 +1,15 @@ import { ErrorComponent, Link, - rootRouteId, - useMatch, + useLocation, useRouter, } from '@tanstack/solid-router' import type { ErrorComponentProps } from '@tanstack/solid-router' export function DefaultCatchBoundary({ error }: ErrorComponentProps) { const router = useRouter() - const isRoot = useMatch({ - strict: false, - select: (state) => state.id === rootRouteId, + const isRoot = useLocation({ + select: (location) => location.pathname === '/', }) console.error(error) diff --git a/e2e/solid-start/website/src/components/DefaultCatchBoundary.tsx b/e2e/solid-start/website/src/components/DefaultCatchBoundary.tsx index 2c0d464a06..f44db955a0 100644 --- a/e2e/solid-start/website/src/components/DefaultCatchBoundary.tsx +++ b/e2e/solid-start/website/src/components/DefaultCatchBoundary.tsx @@ -1,17 +1,15 @@ import { ErrorComponent, Link, - rootRouteId, - useMatch, + useLocation, useRouter, } from '@tanstack/solid-router' import type { ErrorComponentProps } from '@tanstack/solid-router' export function DefaultCatchBoundary({ error }: ErrorComponentProps) { const router = useRouter() - const isRoot = useMatch({ - strict: false, - select: (state) => state.id === rootRouteId, + const isRoot = useLocation({ + select: (location) => location.pathname === '/', }) console.error(error) diff --git a/e2e/vue-start/basic-auth/src/components/DefaultCatchBoundary.tsx b/e2e/vue-start/basic-auth/src/components/DefaultCatchBoundary.tsx index e11970b600..02caf56456 100644 --- a/e2e/vue-start/basic-auth/src/components/DefaultCatchBoundary.tsx +++ b/e2e/vue-start/basic-auth/src/components/DefaultCatchBoundary.tsx @@ -1,17 +1,15 @@ import { ErrorComponent, Link, - rootRouteId, - useMatch, + useLocation, useRouter, } from '@tanstack/vue-router' import type { ErrorComponentProps } from '@tanstack/vue-router' export function DefaultCatchBoundary({ error }: ErrorComponentProps) { const router = useRouter() - const isRoot = useMatch({ - strict: false, - select: (state) => state.id === rootRouteId, + const isRoot = useLocation({ + select: (location) => location.pathname === '/', }) console.error(error) diff --git a/e2e/vue-start/basic-cloudflare/src/components/DefaultCatchBoundary.tsx b/e2e/vue-start/basic-cloudflare/src/components/DefaultCatchBoundary.tsx index e11970b600..02caf56456 100644 --- a/e2e/vue-start/basic-cloudflare/src/components/DefaultCatchBoundary.tsx +++ b/e2e/vue-start/basic-cloudflare/src/components/DefaultCatchBoundary.tsx @@ -1,17 +1,15 @@ import { ErrorComponent, Link, - rootRouteId, - useMatch, + useLocation, useRouter, } from '@tanstack/vue-router' import type { ErrorComponentProps } from '@tanstack/vue-router' export function DefaultCatchBoundary({ error }: ErrorComponentProps) { const router = useRouter() - const isRoot = useMatch({ - strict: false, - select: (state) => state.id === rootRouteId, + const isRoot = useLocation({ + select: (location) => location.pathname === '/', }) console.error(error) diff --git a/e2e/vue-start/basic/src/components/DefaultCatchBoundary.tsx b/e2e/vue-start/basic/src/components/DefaultCatchBoundary.tsx index fe99cf62f3..cd0fa98fc7 100644 --- a/e2e/vue-start/basic/src/components/DefaultCatchBoundary.tsx +++ b/e2e/vue-start/basic/src/components/DefaultCatchBoundary.tsx @@ -1,11 +1,9 @@ import { ErrorComponent, Link, - rootRouteId, - useMatch, + useLocation, useRouter, } from '@tanstack/vue-router' -import type { ErrorComponentProps } from '@tanstack/vue-router' import { defineComponent } from 'vue' export const DefaultCatchBoundary = defineComponent({ @@ -17,9 +15,8 @@ export const DefaultCatchBoundary = defineComponent({ }, setup(props) { const router = useRouter() - const isRoot = useMatch({ - strict: false, - select: (state) => state.id === rootRouteId, + const isRoot = useLocation({ + select: (location) => location.pathname === '/', }) console.error(props.error) diff --git a/e2e/vue-start/custom-basepath/src/components/DefaultCatchBoundary.tsx b/e2e/vue-start/custom-basepath/src/components/DefaultCatchBoundary.tsx index b1f818dd74..d06f4a948b 100644 --- a/e2e/vue-start/custom-basepath/src/components/DefaultCatchBoundary.tsx +++ b/e2e/vue-start/custom-basepath/src/components/DefaultCatchBoundary.tsx @@ -1,17 +1,15 @@ import { ErrorComponent, Link, - rootRouteId, - useMatch, + useLocation, useRouter, } from '@tanstack/vue-router' import type { ErrorComponentProps } from '@tanstack/vue-router' export function DefaultCatchBoundary({ error }: ErrorComponentProps) { const router = useRouter() - const isRoot = useMatch({ - strict: false, - select: (state) => state.id === rootRouteId, + const isRoot = useLocation({ + select: (location) => location.pathname === '/', }) console.error(error) diff --git a/e2e/vue-start/scroll-restoration/src/components/DefaultCatchBoundary.tsx b/e2e/vue-start/scroll-restoration/src/components/DefaultCatchBoundary.tsx index b1f818dd74..d06f4a948b 100644 --- a/e2e/vue-start/scroll-restoration/src/components/DefaultCatchBoundary.tsx +++ b/e2e/vue-start/scroll-restoration/src/components/DefaultCatchBoundary.tsx @@ -1,17 +1,15 @@ import { ErrorComponent, Link, - rootRouteId, - useMatch, + useLocation, useRouter, } from '@tanstack/vue-router' import type { ErrorComponentProps } from '@tanstack/vue-router' export function DefaultCatchBoundary({ error }: ErrorComponentProps) { const router = useRouter() - const isRoot = useMatch({ - strict: false, - select: (state) => state.id === rootRouteId, + const isRoot = useLocation({ + select: (location) => location.pathname === '/', }) console.error(error) diff --git a/e2e/vue-start/server-functions/src/components/DefaultCatchBoundary.tsx b/e2e/vue-start/server-functions/src/components/DefaultCatchBoundary.tsx index b1f818dd74..d06f4a948b 100644 --- a/e2e/vue-start/server-functions/src/components/DefaultCatchBoundary.tsx +++ b/e2e/vue-start/server-functions/src/components/DefaultCatchBoundary.tsx @@ -1,17 +1,15 @@ import { ErrorComponent, Link, - rootRouteId, - useMatch, + useLocation, useRouter, } from '@tanstack/vue-router' import type { ErrorComponentProps } from '@tanstack/vue-router' export function DefaultCatchBoundary({ error }: ErrorComponentProps) { const router = useRouter() - const isRoot = useMatch({ - strict: false, - select: (state) => state.id === rootRouteId, + const isRoot = useLocation({ + select: (location) => location.pathname === '/', }) console.error(error) diff --git a/e2e/vue-start/server-routes/src/components/DefaultCatchBoundary.tsx b/e2e/vue-start/server-routes/src/components/DefaultCatchBoundary.tsx index b1f818dd74..d06f4a948b 100644 --- a/e2e/vue-start/server-routes/src/components/DefaultCatchBoundary.tsx +++ b/e2e/vue-start/server-routes/src/components/DefaultCatchBoundary.tsx @@ -1,17 +1,15 @@ import { ErrorComponent, Link, - rootRouteId, - useMatch, + useLocation, useRouter, } from '@tanstack/vue-router' import type { ErrorComponentProps } from '@tanstack/vue-router' export function DefaultCatchBoundary({ error }: ErrorComponentProps) { const router = useRouter() - const isRoot = useMatch({ - strict: false, - select: (state) => state.id === rootRouteId, + const isRoot = useLocation({ + select: (location) => location.pathname === '/', }) console.error(error) diff --git a/e2e/vue-start/website/src/components/DefaultCatchBoundary.tsx b/e2e/vue-start/website/src/components/DefaultCatchBoundary.tsx index b1f818dd74..d06f4a948b 100644 --- a/e2e/vue-start/website/src/components/DefaultCatchBoundary.tsx +++ b/e2e/vue-start/website/src/components/DefaultCatchBoundary.tsx @@ -1,17 +1,15 @@ import { ErrorComponent, Link, - rootRouteId, - useMatch, + useLocation, useRouter, } from '@tanstack/vue-router' import type { ErrorComponentProps } from '@tanstack/vue-router' export function DefaultCatchBoundary({ error }: ErrorComponentProps) { const router = useRouter() - const isRoot = useMatch({ - strict: false, - select: (state) => state.id === rootRouteId, + const isRoot = useLocation({ + select: (location) => location.pathname === '/', }) console.error(error) diff --git a/examples/react/start-basic-auth/src/components/DefaultCatchBoundary.tsx b/examples/react/start-basic-auth/src/components/DefaultCatchBoundary.tsx index ef2daa1ea1..405fb5f4a7 100644 --- a/examples/react/start-basic-auth/src/components/DefaultCatchBoundary.tsx +++ b/examples/react/start-basic-auth/src/components/DefaultCatchBoundary.tsx @@ -1,17 +1,15 @@ import { ErrorComponent, Link, - rootRouteId, - useMatch, + useLocation, useRouter, } from '@tanstack/react-router' import type { ErrorComponentProps } from '@tanstack/react-router' export function DefaultCatchBoundary({ error }: ErrorComponentProps) { const router = useRouter() - const isRoot = useMatch({ - strict: false, - select: (state) => state.id === rootRouteId, + const isRoot = useLocation({ + select: (location) => location.pathname === '/', }) console.error(error) diff --git a/examples/react/start-basic-authjs/src/components/DefaultCatchBoundary.tsx b/examples/react/start-basic-authjs/src/components/DefaultCatchBoundary.tsx index 260c2ea41f..4a22649ed4 100644 --- a/examples/react/start-basic-authjs/src/components/DefaultCatchBoundary.tsx +++ b/examples/react/start-basic-authjs/src/components/DefaultCatchBoundary.tsx @@ -1,17 +1,15 @@ import { ErrorComponent, Link, - rootRouteId, - useMatch, + useLocation, useRouter, } from '@tanstack/react-router' import type { ErrorComponentProps } from '@tanstack/react-router' export function DefaultCatchBoundary({ error }: ErrorComponentProps) { const router = useRouter() - const isRoot = useMatch({ - strict: false, - select: (state) => state.id === rootRouteId, + const isRoot = useLocation({ + select: (location) => location.pathname === '/', }) console.error('DefaultCatchBoundary Error:', error) diff --git a/examples/react/start-basic-cloudflare/src/components/DefaultCatchBoundary.tsx b/examples/react/start-basic-cloudflare/src/components/DefaultCatchBoundary.tsx index 260c2ea41f..4a22649ed4 100644 --- a/examples/react/start-basic-cloudflare/src/components/DefaultCatchBoundary.tsx +++ b/examples/react/start-basic-cloudflare/src/components/DefaultCatchBoundary.tsx @@ -1,17 +1,15 @@ import { ErrorComponent, Link, - rootRouteId, - useMatch, + useLocation, useRouter, } from '@tanstack/react-router' import type { ErrorComponentProps } from '@tanstack/react-router' export function DefaultCatchBoundary({ error }: ErrorComponentProps) { const router = useRouter() - const isRoot = useMatch({ - strict: false, - select: (state) => state.id === rootRouteId, + const isRoot = useLocation({ + select: (location) => location.pathname === '/', }) console.error('DefaultCatchBoundary Error:', error) diff --git a/examples/react/start-basic-react-query/src/components/DefaultCatchBoundary.tsx b/examples/react/start-basic-react-query/src/components/DefaultCatchBoundary.tsx index ef2daa1ea1..405fb5f4a7 100644 --- a/examples/react/start-basic-react-query/src/components/DefaultCatchBoundary.tsx +++ b/examples/react/start-basic-react-query/src/components/DefaultCatchBoundary.tsx @@ -1,17 +1,15 @@ import { ErrorComponent, Link, - rootRouteId, - useMatch, + useLocation, useRouter, } from '@tanstack/react-router' import type { ErrorComponentProps } from '@tanstack/react-router' export function DefaultCatchBoundary({ error }: ErrorComponentProps) { const router = useRouter() - const isRoot = useMatch({ - strict: false, - select: (state) => state.id === rootRouteId, + const isRoot = useLocation({ + select: (location) => location.pathname === '/', }) console.error(error) diff --git a/examples/react/start-basic-static/src/components/DefaultCatchBoundary.tsx b/examples/react/start-basic-static/src/components/DefaultCatchBoundary.tsx index 260c2ea41f..4a22649ed4 100644 --- a/examples/react/start-basic-static/src/components/DefaultCatchBoundary.tsx +++ b/examples/react/start-basic-static/src/components/DefaultCatchBoundary.tsx @@ -1,17 +1,15 @@ import { ErrorComponent, Link, - rootRouteId, - useMatch, + useLocation, useRouter, } from '@tanstack/react-router' import type { ErrorComponentProps } from '@tanstack/react-router' export function DefaultCatchBoundary({ error }: ErrorComponentProps) { const router = useRouter() - const isRoot = useMatch({ - strict: false, - select: (state) => state.id === rootRouteId, + const isRoot = useLocation({ + select: (location) => location.pathname === '/', }) console.error('DefaultCatchBoundary Error:', error) diff --git a/examples/react/start-basic/src/components/DefaultCatchBoundary.tsx b/examples/react/start-basic/src/components/DefaultCatchBoundary.tsx index 260c2ea41f..4a22649ed4 100644 --- a/examples/react/start-basic/src/components/DefaultCatchBoundary.tsx +++ b/examples/react/start-basic/src/components/DefaultCatchBoundary.tsx @@ -1,17 +1,15 @@ import { ErrorComponent, Link, - rootRouteId, - useMatch, + useLocation, useRouter, } from '@tanstack/react-router' import type { ErrorComponentProps } from '@tanstack/react-router' export function DefaultCatchBoundary({ error }: ErrorComponentProps) { const router = useRouter() - const isRoot = useMatch({ - strict: false, - select: (state) => state.id === rootRouteId, + const isRoot = useLocation({ + select: (location) => location.pathname === '/', }) console.error('DefaultCatchBoundary Error:', error) diff --git a/examples/react/start-clerk-basic/src/components/DefaultCatchBoundary.tsx b/examples/react/start-clerk-basic/src/components/DefaultCatchBoundary.tsx index ef2daa1ea1..405fb5f4a7 100644 --- a/examples/react/start-clerk-basic/src/components/DefaultCatchBoundary.tsx +++ b/examples/react/start-clerk-basic/src/components/DefaultCatchBoundary.tsx @@ -1,17 +1,15 @@ import { ErrorComponent, Link, - rootRouteId, - useMatch, + useLocation, useRouter, } from '@tanstack/react-router' import type { ErrorComponentProps } from '@tanstack/react-router' export function DefaultCatchBoundary({ error }: ErrorComponentProps) { const router = useRouter() - const isRoot = useMatch({ - strict: false, - select: (state) => state.id === rootRouteId, + const isRoot = useLocation({ + select: (location) => location.pathname === '/', }) console.error(error) diff --git a/examples/react/start-convex-trellaux/src/components/DefaultCatchBoundary.tsx b/examples/react/start-convex-trellaux/src/components/DefaultCatchBoundary.tsx index ef2daa1ea1..405fb5f4a7 100644 --- a/examples/react/start-convex-trellaux/src/components/DefaultCatchBoundary.tsx +++ b/examples/react/start-convex-trellaux/src/components/DefaultCatchBoundary.tsx @@ -1,17 +1,15 @@ import { ErrorComponent, Link, - rootRouteId, - useMatch, + useLocation, useRouter, } from '@tanstack/react-router' import type { ErrorComponentProps } from '@tanstack/react-router' export function DefaultCatchBoundary({ error }: ErrorComponentProps) { const router = useRouter() - const isRoot = useMatch({ - strict: false, - select: (state) => state.id === rootRouteId, + const isRoot = useLocation({ + select: (location) => location.pathname === '/', }) console.error(error) diff --git a/examples/react/start-supabase-basic/src/components/DefaultCatchBoundary.tsx b/examples/react/start-supabase-basic/src/components/DefaultCatchBoundary.tsx index 30e64b85b9..405fb5f4a7 100644 --- a/examples/react/start-supabase-basic/src/components/DefaultCatchBoundary.tsx +++ b/examples/react/start-supabase-basic/src/components/DefaultCatchBoundary.tsx @@ -1,18 +1,15 @@ -import * as React from 'react' import { ErrorComponent, Link, - rootRouteId, - useMatch, + useLocation, useRouter, } from '@tanstack/react-router' import type { ErrorComponentProps } from '@tanstack/react-router' export function DefaultCatchBoundary({ error }: ErrorComponentProps) { const router = useRouter() - const isRoot = useMatch({ - strict: false, - select: (state) => state.id === rootRouteId, + const isRoot = useLocation({ + select: (location) => location.pathname === '/', }) console.error(error) diff --git a/examples/react/start-trellaux/src/components/DefaultCatchBoundary.tsx b/examples/react/start-trellaux/src/components/DefaultCatchBoundary.tsx index 260c2ea41f..4a22649ed4 100644 --- a/examples/react/start-trellaux/src/components/DefaultCatchBoundary.tsx +++ b/examples/react/start-trellaux/src/components/DefaultCatchBoundary.tsx @@ -1,17 +1,15 @@ import { ErrorComponent, Link, - rootRouteId, - useMatch, + useLocation, useRouter, } from '@tanstack/react-router' import type { ErrorComponentProps } from '@tanstack/react-router' export function DefaultCatchBoundary({ error }: ErrorComponentProps) { const router = useRouter() - const isRoot = useMatch({ - strict: false, - select: (state) => state.id === rootRouteId, + const isRoot = useLocation({ + select: (location) => location.pathname === '/', }) console.error('DefaultCatchBoundary Error:', error) diff --git a/examples/solid/start-basic-auth/src/components/DefaultCatchBoundary.tsx b/examples/solid/start-basic-auth/src/components/DefaultCatchBoundary.tsx index 2c0d464a06..f44db955a0 100644 --- a/examples/solid/start-basic-auth/src/components/DefaultCatchBoundary.tsx +++ b/examples/solid/start-basic-auth/src/components/DefaultCatchBoundary.tsx @@ -1,17 +1,15 @@ import { ErrorComponent, Link, - rootRouteId, - useMatch, + useLocation, useRouter, } from '@tanstack/solid-router' import type { ErrorComponentProps } from '@tanstack/solid-router' export function DefaultCatchBoundary({ error }: ErrorComponentProps) { const router = useRouter() - const isRoot = useMatch({ - strict: false, - select: (state) => state.id === rootRouteId, + const isRoot = useLocation({ + select: (location) => location.pathname === '/', }) console.error(error) diff --git a/examples/solid/start-basic-authjs/src/components/DefaultCatchBoundary.tsx b/examples/solid/start-basic-authjs/src/components/DefaultCatchBoundary.tsx index 1ae7a0cf94..beff7bc210 100644 --- a/examples/solid/start-basic-authjs/src/components/DefaultCatchBoundary.tsx +++ b/examples/solid/start-basic-authjs/src/components/DefaultCatchBoundary.tsx @@ -1,17 +1,15 @@ import { ErrorComponent, Link, - rootRouteId, - useMatch, + useLocation, useRouter, } from '@tanstack/solid-router' import type { ErrorComponentProps } from '@tanstack/solid-router' export function DefaultCatchBoundary({ error }: ErrorComponentProps) { const router = useRouter() - const isRoot = useMatch({ - strict: false, - select: (state) => state.id === rootRouteId, + const isRoot = useLocation({ + select: (location) => location.pathname === '/', }) console.error('DefaultCatchBoundary Error:', error) diff --git a/examples/solid/start-basic-cloudflare/src/components/DefaultCatchBoundary.tsx b/examples/solid/start-basic-cloudflare/src/components/DefaultCatchBoundary.tsx index 1ae7a0cf94..beff7bc210 100644 --- a/examples/solid/start-basic-cloudflare/src/components/DefaultCatchBoundary.tsx +++ b/examples/solid/start-basic-cloudflare/src/components/DefaultCatchBoundary.tsx @@ -1,17 +1,15 @@ import { ErrorComponent, Link, - rootRouteId, - useMatch, + useLocation, useRouter, } from '@tanstack/solid-router' import type { ErrorComponentProps } from '@tanstack/solid-router' export function DefaultCatchBoundary({ error }: ErrorComponentProps) { const router = useRouter() - const isRoot = useMatch({ - strict: false, - select: (state) => state.id === rootRouteId, + const isRoot = useLocation({ + select: (location) => location.pathname === '/', }) console.error('DefaultCatchBoundary Error:', error) diff --git a/examples/solid/start-basic-netlify/src/components/DefaultCatchBoundary.tsx b/examples/solid/start-basic-netlify/src/components/DefaultCatchBoundary.tsx index 1ae7a0cf94..beff7bc210 100644 --- a/examples/solid/start-basic-netlify/src/components/DefaultCatchBoundary.tsx +++ b/examples/solid/start-basic-netlify/src/components/DefaultCatchBoundary.tsx @@ -1,17 +1,15 @@ import { ErrorComponent, Link, - rootRouteId, - useMatch, + useLocation, useRouter, } from '@tanstack/solid-router' import type { ErrorComponentProps } from '@tanstack/solid-router' export function DefaultCatchBoundary({ error }: ErrorComponentProps) { const router = useRouter() - const isRoot = useMatch({ - strict: false, - select: (state) => state.id === rootRouteId, + const isRoot = useLocation({ + select: (location) => location.pathname === '/', }) console.error('DefaultCatchBoundary Error:', error) diff --git a/examples/solid/start-basic-nitro/src/components/DefaultCatchBoundary.tsx b/examples/solid/start-basic-nitro/src/components/DefaultCatchBoundary.tsx index 1ae7a0cf94..beff7bc210 100644 --- a/examples/solid/start-basic-nitro/src/components/DefaultCatchBoundary.tsx +++ b/examples/solid/start-basic-nitro/src/components/DefaultCatchBoundary.tsx @@ -1,17 +1,15 @@ import { ErrorComponent, Link, - rootRouteId, - useMatch, + useLocation, useRouter, } from '@tanstack/solid-router' import type { ErrorComponentProps } from '@tanstack/solid-router' export function DefaultCatchBoundary({ error }: ErrorComponentProps) { const router = useRouter() - const isRoot = useMatch({ - strict: false, - select: (state) => state.id === rootRouteId, + const isRoot = useLocation({ + select: (location) => location.pathname === '/', }) console.error('DefaultCatchBoundary Error:', error) diff --git a/examples/solid/start-basic-solid-query/src/components/DefaultCatchBoundary.tsx b/examples/solid/start-basic-solid-query/src/components/DefaultCatchBoundary.tsx index 2c0d464a06..f44db955a0 100644 --- a/examples/solid/start-basic-solid-query/src/components/DefaultCatchBoundary.tsx +++ b/examples/solid/start-basic-solid-query/src/components/DefaultCatchBoundary.tsx @@ -1,17 +1,15 @@ import { ErrorComponent, Link, - rootRouteId, - useMatch, + useLocation, useRouter, } from '@tanstack/solid-router' import type { ErrorComponentProps } from '@tanstack/solid-router' export function DefaultCatchBoundary({ error }: ErrorComponentProps) { const router = useRouter() - const isRoot = useMatch({ - strict: false, - select: (state) => state.id === rootRouteId, + const isRoot = useLocation({ + select: (location) => location.pathname === '/', }) console.error(error) diff --git a/examples/solid/start-basic-static/src/components/DefaultCatchBoundary.tsx b/examples/solid/start-basic-static/src/components/DefaultCatchBoundary.tsx index 0dff3919fd..db574e0f90 100644 --- a/examples/solid/start-basic-static/src/components/DefaultCatchBoundary.tsx +++ b/examples/solid/start-basic-static/src/components/DefaultCatchBoundary.tsx @@ -1,17 +1,15 @@ import { ErrorComponent, Link, - rootRouteId, - useMatch, + useLocation, useRouter, } from '@tanstack/solid-router' import type { ErrorComponentProps } from '@tanstack/solid-router' export function DefaultCatchBoundary({ error }: ErrorComponentProps) { const router = useRouter() - const isRoot = useMatch({ - strict: false, - select: (state) => state.id === rootRouteId, + const isRoot = useLocation({ + select: (location) => location.pathname === '/', }) console.error('DefaultCatchBoundary Error:', error) diff --git a/examples/solid/start-basic/src/components/DefaultCatchBoundary.tsx b/examples/solid/start-basic/src/components/DefaultCatchBoundary.tsx index 1ae7a0cf94..beff7bc210 100644 --- a/examples/solid/start-basic/src/components/DefaultCatchBoundary.tsx +++ b/examples/solid/start-basic/src/components/DefaultCatchBoundary.tsx @@ -1,17 +1,15 @@ import { ErrorComponent, Link, - rootRouteId, - useMatch, + useLocation, useRouter, } from '@tanstack/solid-router' import type { ErrorComponentProps } from '@tanstack/solid-router' export function DefaultCatchBoundary({ error }: ErrorComponentProps) { const router = useRouter() - const isRoot = useMatch({ - strict: false, - select: (state) => state.id === rootRouteId, + const isRoot = useLocation({ + select: (location) => location.pathname === '/', }) console.error('DefaultCatchBoundary Error:', error) diff --git a/examples/solid/start-supabase-basic/src/components/DefaultCatchBoundary.tsx b/examples/solid/start-supabase-basic/src/components/DefaultCatchBoundary.tsx index 32aed20e67..6de1f0b377 100644 --- a/examples/solid/start-supabase-basic/src/components/DefaultCatchBoundary.tsx +++ b/examples/solid/start-supabase-basic/src/components/DefaultCatchBoundary.tsx @@ -1,17 +1,15 @@ import { ErrorComponent, Link, - rootRouteId, - useMatch, + useLocation, useRouter, } from '@tanstack/solid-router' import type { ErrorComponentProps } from '@tanstack/solid-router' export function DefaultCatchBoundary({ error }: ErrorComponentProps) { const router = useRouter() - const isRoot = useMatch({ - strict: false, - select: (state) => state.id === rootRouteId, + const isRoot = useLocation({ + select: (location) => location.pathname === '/', }) console.error(error)