| ... | ... | @@ -9,6 +9,7 @@ import { |
| 9 | 9 | type ErrorComponentProps, |
| 10 | 10 | useLocation, |
| 11 | 11 | useNavigate, |
| 12 | useRouter, |
| 12 | 13 | } from "@tanstack/react-router"; |
| 13 | 14 | import { CheckIcon, CopyIcon } from "lucide-react"; |
| 14 | 15 | import { useEffect, useEffectEvent, useMemo, useRef, useState } from "react"; |
| ... | ... | @@ -353,7 +354,8 @@ function HostedStaticEnvironmentBootstrap() { |
| 353 | 354 | return null; |
| 354 | 355 | } |
| 355 | 356 | |
| 356 | | function RootRouteErrorView({ error, reset }: ErrorComponentProps) { |
| 357 | function RootRouteErrorView({ error }: ErrorComponentProps) { |
| 358 | const router = useRouter(); |
| 357 | 359 | const message = errorMessage(error); |
| 358 | 360 | // Router pathname rather than window.location: desktop uses hash history, where the window path is always "/". |
| 359 | 361 | const pathname = useLocation({ select: (location) => location.pathname }); |
| ... | ... | @@ -376,7 +378,7 @@ function RootRouteErrorView({ error, reset }: ErrorComponentProps) { |
| 376 | 378 | <p className="mt-2 text-sm leading-relaxed text-muted-foreground">{message}</p> |
| 377 | 379 | |
| 378 | 380 | <div className="mt-5 flex flex-wrap gap-2"> |
| 379 | | <Button size="sm" onClick={() => reset()}> |
| 381 | <Button size="sm" onClick={() => void router.invalidate()}> |
| 380 | 382 | Try again |
| 381 | 383 | </Button> |
| 382 | 384 | <Button size="sm" variant="outline" onClick={() => window.location.reload()}> |