diff options
author | crupest <crupest@outlook.com> | 2021-12-06 20:46:35 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2021-12-06 20:46:35 +0800 |
commit | 2d9ef25d6171890496b1c9dd48a91b11c40eca7c (patch) | |
tree | ac48193d08296dd880005e8e0399b0b48a4bcc5d /FrontEnd/src/views/search | |
parent | de0c85ca334d06f042e685b8263a3261b8f8b055 (diff) | |
download | timeline-2d9ef25d6171890496b1c9dd48a91b11c40eca7c.tar.gz timeline-2d9ef25d6171890496b1c9dd48a91b11c40eca7c.tar.bz2 timeline-2d9ef25d6171890496b1c9dd48a91b11c40eca7c.zip |
...
Diffstat (limited to 'FrontEnd/src/views/search')
-rw-r--r-- | FrontEnd/src/views/search/index.tsx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/FrontEnd/src/views/search/index.tsx b/FrontEnd/src/views/search/index.tsx index 509fd8c0..60eb6306 100644 --- a/FrontEnd/src/views/search/index.tsx +++ b/FrontEnd/src/views/search/index.tsx @@ -1,6 +1,6 @@ import React from "react"; import { useTranslation } from "react-i18next"; -import { useHistory, useLocation } from "react-router"; +import { useNavigate, useLocation } from "react-router-dom"; import { Link } from "react-router-dom"; import { HttpNetworkError } from "@/http/common"; @@ -44,7 +44,7 @@ const TimelineSearchResultItemView: React.FC<{ const SearchPage: React.FC = () => { const { t } = useTranslation(); - const history = useHistory(); + const navigate = useNavigate(); const location = useLocation(); const searchParams = new URLSearchParams(location.search); const queryParam = searchParams.get("q"); @@ -90,7 +90,7 @@ const SearchPage: React.FC = () => { if (queryParam === searchText) { setForceResearchKey((old) => old + 1); } else { - history.push(`/search?q=${searchText}`); + navigate(`/search?q=${searchText}`); } }} /> |