Skip to content

Commit 2e90b23

Browse files
committed
Use <Navigate> component insert of redirect()
1 parent be01f11 commit 2e90b23

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

frontend/src/routes/_account.plan.index.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// Please see LICENSE in the repository root for full details.
55

66
import { queryOptions, useSuspenseQuery } from "@tanstack/react-query";
7-
import { createFileRoute, redirect, useRouter } from "@tanstack/react-router";
7+
import { createFileRoute, Navigate } from "@tanstack/react-router";
88
import { useCallback, useEffect, useRef, useState } from "react";
99
import { graphql, useFragment } from "../gql";
1010
import { graphqlRequest } from "../graphql";
@@ -39,9 +39,8 @@ function Plan(): React.ReactElement {
3939
const { planManagementIframeUri } = useFragment(CONFIG_FRAGMENT, siteConfig);
4040

4141
if (!planManagementIframeUri) {
42-
const { navigate } = useRouter();
43-
navigate({ to: "/", replace: true }); // Redirect if no iframe URI is configured
44-
return <div />;
42+
// Redirect if no iframe URI is configured
43+
return <Navigate to="/" replace />;
4544
}
4645

4746
const ref = useRef<HTMLIFrameElement>(null);

0 commit comments

Comments
 (0)