Fix bug UI and update variable name

This commit is contained in:
2023-10-30 14:57:53 +07:00
parent 96bbe99523
commit af4af45aeb
3 changed files with 13 additions and 13 deletions
+4 -4
View File
@@ -9,19 +9,19 @@ const StyledSearch = styled.input`
`;
interface ISearch {
setKeyPhone: React.Dispatch<React.SetStateAction<string>>;
setPhoneSearch: React.Dispatch<React.SetStateAction<string>>;
}
const Search = ({ setKeyPhone }: ISearch) => {
const Search = ({ setPhoneSearch }: ISearch) => {
const [query, setQuery] = useState('');
useEffect(() => {
const timeOut = setTimeout(() => {
setKeyPhone(query);
setPhoneSearch(query);
}, 500);
return () => clearTimeout(timeOut);
}, [setKeyPhone, query]);
}, [setPhoneSearch, query]);
return (
<StyledSearch