Skip to content

Commit

Permalink
Fix: resolve searchBar typeError
Browse files Browse the repository at this point in the history
  • Loading branch information
Yamyam-code committed Jan 10, 2024
1 parent 3ceabdf commit 9c6627e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/components/SearchFromHome/SearchBar/SearchBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,16 @@ import styles from "./SearchBar.module.scss";

interface PropsType {
set: React.Dispatch<React.SetStateAction<string | undefined>>;
keyword: string;
keyword: string | undefined;
}

function SearchBar({ set, keyword }: PropsType) {
const [inputValue, setInputValue] = useState("");

useEffect(() => {
setInputValue(keyword);
if (keyword) {
setInputValue(keyword);
}
}, [keyword]);

function handleInputValue(e: React.ChangeEvent<HTMLInputElement>) {
Expand Down

0 comments on commit 9c6627e

Please sign in to comment.