搜索关键词默认值
This commit is contained in:
@@ -26,7 +26,7 @@ export default function RepositoryList (props:RepositoryListProps) {
|
|||||||
useContext(RepositorySearchContext)
|
useContext(RepositorySearchContext)
|
||||||
|
|
||||||
/** 搜索关键词 */
|
/** 搜索关键词 */
|
||||||
const [keyword, setKeyword] = useState(props.keyword)
|
const [keyword, setKeyword] = useState('')
|
||||||
|
|
||||||
const cache = RepositorySearchCache(keyword, props.max_cache_page)
|
const cache = RepositorySearchCache(keyword, props.max_cache_page)
|
||||||
|
|
||||||
@@ -88,7 +88,8 @@ export default function RepositoryList (props:RepositoryListProps) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
search(keyword,1)
|
setKeyword(props.keyword)
|
||||||
|
search(props.keyword,1)
|
||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
function onClickPrev(){
|
function onClickPrev(){
|
||||||
|
Reference in New Issue
Block a user