How to start search only when user stops typing?

后端 未结 10 1773

I need to perform a Search when user stops typing.I know I am supposed to use setTimeout() . But with Reactjs I cant find how it works. Can

10条回答
  •  失恋的感觉
    2020-12-07 18:55

    User lodash javascript library and use [_.debounce][1]

    changeName: _.debounce(function (val) {
      console.log(val)                
    }, 1000)
    

提交回复
热议问题