diff --git a/src/components/Dropdown/index.tsx b/src/components/Dropdown/index.tsx index db976f5..fcd450a 100644 --- a/src/components/Dropdown/index.tsx +++ b/src/components/Dropdown/index.tsx @@ -148,10 +148,12 @@ const DropdownComponent: ( ); useEffect(() => { - const filterData = excludeData(data); - setListData([...filterData]); - if (searchText) { - onSearch(searchText); + if (data && data.length > 0) { + const filterData = excludeData(data); + setListData([...filterData]); + if (searchText) { + onSearch(searchText); + } } // eslint-disable-next-line react-hooks/exhaustive-deps }, [data, searchText]);