From 2d9ef25d6171890496b1c9dd48a91b11c40eca7c Mon Sep 17 00:00:00 2001
From: crupest <crupest@outlook.com>
Date: Mon, 6 Dec 2021 20:46:35 +0800
Subject: ...

---
 FrontEnd/src/views/center/TimelineCreateDialog.tsx | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

(limited to 'FrontEnd/src/views/center/TimelineCreateDialog.tsx')

diff --git a/FrontEnd/src/views/center/TimelineCreateDialog.tsx b/FrontEnd/src/views/center/TimelineCreateDialog.tsx
index 4871a5e0..d3b30575 100644
--- a/FrontEnd/src/views/center/TimelineCreateDialog.tsx
+++ b/FrontEnd/src/views/center/TimelineCreateDialog.tsx
@@ -1,5 +1,5 @@
 import React from "react";
-import { useHistory } from "react-router";
+import { useNavigate } from "react-router-dom";
 
 import { validateTimelineName } from "@/services/timeline";
 import OperationDialog from "../common/dailog/OperationDialog";
@@ -11,7 +11,7 @@ interface TimelineCreateDialogProps {
 }
 
 const TimelineCreateDialog: React.FC<TimelineCreateDialogProps> = (props) => {
-  const history = useHistory();
+  const navigate = useNavigate();
 
   return (
     <OperationDialog
@@ -43,7 +43,7 @@ const TimelineCreateDialog: React.FC<TimelineCreateDialogProps> = (props) => {
         getHttpTimelineClient().postTimeline({ name })
       }
       onSuccessAndClose={(timeline: HttpTimelineInfo) => {
-        history.push(`timelines/${timeline.name}`);
+        navigate(`timelines/${timeline.name}`);
       }}
       failurePrompt={(e) => `${e as string}`}
     />
-- 
cgit v1.2.3

