From 5817d0d9af9ee7f21bb5bb1a36e663cca1881505 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=91=A8=E7=82=BD=E9=94=AE?= <397201698@qq.com> Date: Tue, 27 Jul 2021 16:39:14 +0800 Subject: [PATCH] =?UTF-8?q?=E6=90=9C=E7=B4=A2=E5=85=B3=E9=94=AE=E8=AF=8D?= =?UTF-8?q?=E9=BB=98=E8=AE=A4=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/RepositoryList.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/RepositoryList.tsx b/src/components/RepositoryList.tsx index 4ccd4c2..90ab64f 100755 --- a/src/components/RepositoryList.tsx +++ b/src/components/RepositoryList.tsx @@ -26,7 +26,7 @@ export default function RepositoryList (props:RepositoryListProps) { useContext(RepositorySearchContext) /** 搜索关键词 */ - const [keyword, setKeyword] = useState(props.keyword) + const [keyword, setKeyword] = useState('') const cache = RepositorySearchCache(keyword, props.max_cache_page) @@ -88,7 +88,8 @@ export default function RepositoryList (props:RepositoryListProps) { } useEffect(() => { - search(keyword,1) + setKeyword(props.keyword) + search(props.keyword,1) }, []) function onClickPrev(){