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

@ -1,7 +1,7 @@
import { useCallback, useEffect, useState } from 'react';
import styled from '@emotion/styled';
import debounce from 'lodash.debounce';
import { useRecoilValue } from 'recoil';
import { useDebouncedCallback } from 'use-debounce';
import { currentWorkspaceState } from '@/auth/states/currentWorkspaceState';
import { TextInput } from '@/ui/input/components/TextInput';
@ -38,7 +38,7 @@ export const NameField = ({
// TODO: Enhance this with react-web-hook-form (https://www.react-hook-form.com)
// eslint-disable-next-line react-hooks/exhaustive-deps
const debouncedUpdate = useCallback(
debounce(async (name: string) => {
useDebouncedCallback(async (name: string) => {
if (isDefined(onNameUpdate)) {
onNameUpdate(displayName);
}