refactor(chore):3896-replace-lodash-debounce-to-useDebounce (#4814)

Close: #3896 

## PR Details

Changed `lodash.debounce` to `useDebounce`.

Co-authored-by: VoitovychDM <voitovych.dm.m@gmail.com>
This commit is contained in:
Dmitriy Voytovich
2024-04-05 19:07:44 +02:00
committed by GitHub
parent 7774ef68a2
commit a95972f808
6 changed files with 18 additions and 14 deletions

View File

@ -9,8 +9,8 @@ import {
size,
useFloating,
} from '@floating-ui/react';
import debounce from 'lodash.debounce';
import { ReadonlyDeep } from 'type-fest';
import { useDebouncedCallback } from 'use-debounce';
import { SelectOption } from '@/spreadsheet-import/types';
import { AppTooltip } from '@/ui/display/tooltip/AppTooltip';
@ -72,9 +72,13 @@ export const MatchColumnSelect = ({
[initialOptions],
);
const debouncedHandleSearchFilter = debounce(handleSearchFilterChange, 100, {
leading: true,
});
const debouncedHandleSearchFilter = useDebouncedCallback(
handleSearchFilterChange,
100,
{
leading: true,
},
);
const handleFilterChange = (event: React.ChangeEvent<HTMLInputElement>) => {
const value = event.currentTarget.value;