Skip to content

Commit

Permalink
refactor(FullSearch): replace useDebounce with useDebouncedCallback f…
Browse files Browse the repository at this point in the history
…or improved performance
  • Loading branch information
olafsulich committed Jan 14, 2025
1 parent c136ca4 commit 9b2f283
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/script/page/MainContent/panels/Collection/FullSearch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

import React, {useEffect, useMemo, useRef, useState} from 'react';

import {useDebounce} from 'use-debounce';
import {useDebouncedCallback} from 'use-debounce';

import {CloseIcon, Input, InputSubmitCombo, SearchIcon} from '@wireapp/react-ui-kit';

Expand Down Expand Up @@ -54,7 +54,7 @@ const FullSearch: React.FC<FullSearchProps> = ({searchProvider, click = noop, ch
const [hasNoResults, setHasNoResults] = useState(false);
const [element, setElement] = useEffectRef<HTMLDivElement>();

const [debouncedSearch] = useDebounce(async () => {
const debouncedSearch = useDebouncedCallback(async () => {
const trimmedInput = searchValue.trim();
change(trimmedInput);
if (trimmedInput.length < 2) {
Expand Down

0 comments on commit 9b2f283

Please sign in to comment.