updated to useThrottleCallback

This commit is contained in:
Abhinav-grd 2021-05-24 14:02:58 +05:30
parent b04fcee3f9
commit 800e2d74df

View file

@ -3,7 +3,7 @@ import React, { useEffect, useState, useRef } from 'react';
import styled from 'styled-components'; import styled from 'styled-components';
import AsyncSelect from 'react-select/async'; import AsyncSelect from 'react-select/async';
import { components } from 'react-select'; import { components } from 'react-select';
import { useDebouncedCallback } from 'use-debounce'; import { useThrottledCallback } from 'use-debounce';
import { File, getLocalFiles } from 'services/fileService'; import { File, getLocalFiles } from 'services/fileService';
import { import {
Collection, Collection,
@ -200,7 +200,7 @@ export default function SearchBar(props: Props) {
}), }),
}; };
const getOptions = useDebouncedCallback(getAutoCompleteSuggestion, 250); const getOptions = useThrottledCallback(getAutoCompleteSuggestion, 250);
return ( return (
<Wrapper open={props.isOpen}> <Wrapper open={props.isOpen}>