搜索关键词默认值
This commit is contained in:
parent
e8317fd749
commit
5817d0d9af
|
@ -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(){
|
||||
|
|
Loading…
Reference in New Issue