time-picker
time-picker copied to clipboard
TypeScript error when using autoComplete
Thank you for this library! I want to prevent the browser showing previous input values over the time picker overlay:
When adding the autoComplete={'off'} attribute like so:
import * as React from 'react'
import TimePicker from 'rc-time-picker'
import 'rc-time-picker/assets/index.css'
const MyTimePicker: React.FunctionComponent<any> = ({className, name, onChange}) => {
const classNames = [className, 'my-time-input'].join(' ')
return <>
<TimePicker className={classNames} name={name} autoComplete={'off'}/>
</>
}
export default MyTimePicker
the TypeScript compiler is giving the following error:
TS2769: No overload matches this call.
Overload 1 of 2, '(props: Readonly<TimePickerProps>): TimePicker', gave the following error.
Type '{ className: string; name: any; onChange: any; autoComplete: string; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<TimePicker> & Readonly<TimePickerProps> & Readonly<{ children?: ReactNode; }>'.
Property 'autoComplete' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes<TimePicker> & Readonly<TimePickerProps> & Readonly<{ children?: ReactNode; }>'.
Overload 2 of 2, '(props: TimePickerProps, context?: any): TimePicker', gave the following error.
Type '{ className: string; name: any; onChange: any; autoComplete: string; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<TimePicker> & Readonly<TimePickerProps> & Readonly<{ children?: ReactNode; }>'.
Property 'autoComplete' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes<TimePicker> & Readonly<TimePickerProps> & Readonly<{ children?: ReactNode; }>'.
To remove the error I added autoComplete?: 'off' | 'on';
in index.d.ts
.
Am I using the TimePicker incorrectly, or should the autoComplete property be added to index.d.ts
?