Browse Source

fix: type error (#9708)

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

Loading…
Cancel
Save