useRequest options支持动态 #1888
Unanswered
max82645235
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
当我在函数组件内使用 useRquest hook, 一些情况需要开启debounceWait (比如 input输入时), 有些情况需要关闭debounce,
官网文档中表示 options.debounceWait、options.debounceLeading、options.debounceTrailing、options.debounceMaxWait 支持动态变化.
请问该如何设置?
`
... const LabelModelList: React.FC = () => {
.....
const {run: requestService, loading: searchLoading} = useRequest(getModelListService,{
manual: true,
onSuccess: (result,params) => {
if(result?.list){
setModelList(result.list)
}
},
debounceWait: 600,
})
.....
}
`
debounceWait 如何设置为动态?
Beta Was this translation helpful? Give feedback.
All reactions