({ error }: ErrorComponentProps)
| 124 | }) |
| 125 | |
| 126 | function PostErrorComponent({ error }: ErrorComponentProps) { |
| 127 | const router = useRouter() |
| 128 | if (error instanceof NotFoundError) { |
| 129 | return <div>{error.message}</div> |
| 130 | } |
| 131 | const queryErrorResetBoundary = useQueryErrorResetBoundary() |
| 132 | |
| 133 | React.useEffect(() => { |
| 134 | queryErrorResetBoundary.reset() |
| 135 | }, [queryErrorResetBoundary]) |
| 136 | |
| 137 | return ( |
| 138 | <div> |
| 139 | <button |
| 140 | onClick={() => { |
| 141 | router.invalidate() |
| 142 | }} |
| 143 | > |
| 144 | retry |
| 145 | </button> |
| 146 | <ErrorComponent error={error} /> |
| 147 | </div> |
| 148 | ) |
| 149 | } |
| 150 | |
| 151 | function PostRouteComponent() { |
| 152 | const { postId } = postRoute.useParams() |
nothing calls this directly
no test coverage detected