Shun Miyazawa 2 лет назад
Родитель
Сommit
e7a544bac9
1 измененных файлов с 4 добавлено и 4 удалено
  1. 4 4
      apps/app/src/features/search/client/components/SearchForm.tsx

+ 4 - 4
apps/app/src/features/search/client/components/SearchForm.tsx

@@ -31,13 +31,14 @@ export const SearchForm = (props: Props): JSX.Element => {
 
   const inputOption = useMemo(() => {
     return ({
-      ref: inputRef,
       type: 'text',
-      value: searchKeyword,
       placeholder: 'Search...',
       className: 'form-control',
+      ref: inputRef,
+      value: searchKeyword,
+      onChange: changeSearchTextHandler,
     });
-  }, [searchKeyword]);
+  }, [changeSearchTextHandler, searchKeyword]);
 
   useEffect(() => {
     if (inputRef.current != null) {
@@ -51,7 +52,6 @@ export const SearchForm = (props: Props): JSX.Element => {
 
       <input
         {...getInputProps(inputOption)}
-        onChange={changeSearchTextHandler}
       />
 
       <button