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