Browse Source

fix: type error (#9708)

pull/9728/head
dengqing 4 years ago
committed by GitHub
parent
commit
a2f83ca834
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      src/components/HeaderSearch/index.tsx

5
src/components/HeaderSearch/index.tsx

@ -1,4 +1,5 @@
import { SearchOutlined } from '@ant-design/icons';
import type { InputRef } from 'antd';
import { AutoComplete, Input } from 'antd';
import useMergedState from 'rc-util/es/hooks/useMergedState';
import type { AutoCompleteProps } from 'antd/es/auto-complete';
@ -31,7 +32,7 @@ const HeaderSearch: React.FC<HeaderSearchProps> = (props) => {
...restProps
} = props;
const inputRef = useRef<Input | null>(null);
const inputRef = useRef<InputRef | null>(null);
const [value, setValue] = useMergedState<string | undefined>(defaultValue, {
value: props.value,
@ -74,7 +75,7 @@ const HeaderSearch: React.FC<HeaderSearchProps> = (props) => {
className={inputClass}
value={value}
options={restProps.options}
onChange={setValue}
onChange={(completeValue) => setValue(completeValue)}
>
<Input
size="small"

Loading…
Cancel
Save