import { useDebouncedCallback } from 'use-debounce'; - install npm packge for same if not installed
const [searchText, setSearchText] = useState('');
const onSearchTextChange = value => {
setSearchText(value);
};
//call search api
const [debouncedOnSearch] = useDebouncedCallback(searchIssues, 500);
useEffect(() => {
debouncedOnSearch(searchText);
}, [searchText, debouncedOnSearch]);