import { ErrorComponent, Link, rootRouteId, useMatch, 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, }); console.error("DefaultCatchBoundary Error:", error); return (
{isRoot ? ( Home ) : ( { e.preventDefault(); window.history.back(); }} > Go Back )}
); }